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 |
Re:这个程序很简单,为什们用那么多mem(3248K 157MS),怎么节省mem?求解In Reply To:这个程序很简单,为什们用那么多mem(3248K 157MS),怎么节省mem?求解 Posted by:xjtuzxh at 2014-09-05 17:28:35 > import java.io.*; > import java.util.*; > import java.math.*; > import java.text.*; > public class Main1004{ > static Scanner cin=new Scanner(System.in); > static public PrintWriter cout=new PrintWriter(System.out,true); > public static void main(String[]args) > { > double sum=0; > double average=0; > for(int i=0;i<12;i++) > { > sum+=cin.nextDouble(); > } > average=sum/12; > DecimalFormat df=new DecimalFormat("0.00"); > cout.println("$"+df.format(average)); > } > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator