#13958: AC_HAHA


terry90209@gmail.com (Mini)

School : No School
ID : 78019
IP address : [219.71.215.231]
Last Login :
2018-04-03 22:44:44
d071. 格瑞哥里的煩惱 (EOF 版) -- 板橋高中教學題 | From: [110.28.168.153] | Post Date : 2018-05-20 16:17

public class D071{
public static void main(String[] args){
java.util.Scanner sc = new java.util.Scanner(System.in);
while(sc.hasNext()){
int year = sc.nextInt();
print(isLeapYear(year));
}
}

public static boolean isLeapYear(int y) {
return y % 400 == 0 ? true : (y % 4 == 0 && y % 100 != 0) ? true : false;
}

public static void print(boolean b){
if(b) System.out.println("a leap year");
else System.out.println("a normal year");
}
}

 

 
ZeroJudge Forum