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 |
为什么我这过错了In Reply To:这题为什么有人用java也可以0MS过? Posted by:clark at 2004-12-19 09:39:37 import java.io.*; import java.util.*; import java.text.DecimalFormat; //import java.text.NumberFormat; public class Main { public static void main(String args[]) { Scanner cin; double read=0; double result=0; DecimalFormat format=new DecimalFormat("#0.##"); for(int count=1;count<=12;count++) { cin=new Scanner(System.in); read=cin.nextDouble(); result=result+read; } System.out.println("$"+format.format(result/12)); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator