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

我是新手,大家能否看看这个程序,说RunTime error

Posted by seu_cose at 2006-04-19 11:34:37
import java.text.DecimalFormat;
import java.util.*;
public class acm {
       public static void main(String args[]) throws Exception {
		float[] a = new float[12];
		float j = 0;
                  for (int i = 0; i < 12; i++) {
		     Scanner cin = new Scanner(System.in);
		     a[i] = cin.nextFloat();
		     j = a[i] + j;
		}
		j = j / 12;
		DecimalFormat formatter = new DecimalFormat("#.00");
                  Currency currency = Currency.getInstance(Locale.US);
                  String symbol = currency.getSymbol(Locale.US);
		String r = formatter.format(j);
                  System.out.print(symbol + r);
	}

}

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