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

坚持用JAVA。记住最后不要转行和带刀。

Posted by dengyaolong at 2013-03-23 10:51:53 on Problem 1004
import java.text.DecimalFormat;
import java.util.Scanner;

public class Main{

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		double sum=0,inn;
		Scanner cin=new Scanner(System.in);
		int i=0;
			for(i=0;i<12;i++){
				inn=cin.nextDouble();
				sum+=inn;
}
		

		
		String parten = "#.##";
		DecimalFormat decimal = new DecimalFormat(parten);
		String str= decimal.format(sum/12.0);
				 System.out.print("$"+str);

	}

}

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