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

刚上传了第1000题代码,可是提示这样的错误信息,求助

Posted by jinxingdi at 2008-10-14 20:35:45
import  java.io.*;
import  java.util.*;

public class Sum
 {
    public static void main(String[] args)
        {
         try{
            
            BufferedReader in = 
                  new BufferedReader(new InputStreamReader(System.in));

             System.out.println("输入a:");
             String s = in.readLine();
             int a = Integer.parseInt(s);

             System.out.println("输入b:");
             String s1 = in.readLine(); 
             int b = Integer.parseInt(s1);

             int sum = a+b;
             System.out.println("a+b=" +sum);
           } catch(Exception e){}
        }

 }


提示错误:
Compile Error

Main.java:4: class Sum is public, should be declared in a file named Sum.java
public class Sum
       ^
1 error


求助求助

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