| 123456789101112131415161718 |
- /**
- * @author WanJl
- * @version 1.0
- * @title HomeWork05
- * @description 7月14日课后作业-判断年份
- * @create 2026/7/15
- */
- public class HomeWork01 {
- public static void main(String[] args) {
- int year = 2000; //年份
- //判断 是否是闰年
- if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
- System.out.println(year + "是闰年");
- } else {
- System.out.println(year + "是平年");
- }
- }
- }
|