#5766: 用Eclipse可以執行但是到這就錯了


d29696989 (Childe)

學校 : 臺北市立松山高級中學
編號 : 19957
來源 : [114.42.196.2]
最後登入時間 :
2013-10-02 23:56:51
a003. 兩光法師占卜術 | From: [112.105.136.129] | 發表日期 : 2011-09-03 17:20

這是這裡給的錯誤訊息: 

/tmp/code_888616.java:2: class a003 is public, should be declared in a file named a003.java
public class a003
       ^
1 error

這是我寫的程式:

import java.util.Scanner;
public class a003
{
 public static void main(String[] args)
 {
  Scanner sc = new Scanner(System.in);
  int M,D,S;
  M = sc.nextInt();
  D = sc.nextInt();
  S = (M*2+D)%3;
  if(S == 0)
  System.out.println("普通");
  if(S == 1)
  System.out.println("吉");
  if(S == 2)
  System.out.println("大吉");
 }

}

請問一下這錯在哪裡??

 
ZeroJudge Forum