public class Task01 {
public static void main(String[] args) {
// 声明部分
int year;
String result;
Scanner sc = new Scanner(System.in);
// 输入部分
System.out.print("year = ");
year = sc.nextInt();
// 处理部分
if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
result = year + "是闰年。";
} else {
result = year + "是平年。";
}
// 输出部分
System.out.println(result);
}
}
结果