Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Financial Management

Posted by 15686354699 at 2015-05-21 18:54:08 on Problem 1004
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		float[] money = new float[12];
		for (int i = 0; i < money.length; i++) {
			money[i] = in.nextFloat();
		}
		float sum =0f;
		for (float d : money) {
			sum+=d;
		}
		System.out.printf("$%.2f", sum/money.length);
	}
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator