HomeWork01.java 481 B

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