import java.util.Scanner;
public class test {
public static void main(String[]argv) {
Scanner scanner = new Scanner(System.in);
System.out.println("輸入數字:");
int a = scanner.nextInt();
for(int i =1 ; i<= a ; i++)
{
System.out.println("輸入出生年份:");
int p=scanner.nextInt();
if(p%4==0 & p%100!=0 | p%400==0)
{
System.out.println("case "+i+" a leap year");
}
else
{
System.out.println("case "+i+" a normal year");
}
}
}
}
編譯錯了嗎~~?
還是吃WA呢~ ><