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

为什么我这过错了

Posted by nabber at 2006-07-21 16:26:17 on Problem 1004
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:
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