import java.io.*;
public class test06{
public static void main(String[] args)throws IOException
{
BufferedReader input = new BufferedReader
(new InputStreamReader(System.in));

int year;
System.out.print("請輸入要測試的年份ex:1900 : ");
year = Integer.parseInt(input.readLine());
if(year%400==0)
System.out.print("您輸入的"+year+"是閏年");
else if ((year%4==0)&&(year%100!=0))
System.out.print("您輸入的"+year+"是閏年");
else

System.out.print("您輸入的"+year+"不是閏年");
}
}
arrow
arrow
    全站熱搜

    Neo Chao 發表在 痞客邦 留言(0) 人氣()