Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Financial Managementimport 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator