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

这个程序很简单,为什们用那么多mem(3248K 157MS),怎么节省mem?求解

Posted by xjtuzxh at 2014-09-05 17:28:35 on Problem 1004
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:
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