public class Demo12 {
public static void main(String[] args) {
for (int year = 1900; year < 2022; year++) { //for循环从1900年到2021年
if (year % 4 == 0 || (year % 400 == 0 && year % 100 != 0)) { //如何判断这一年是否是闰年
System.out.println(year);
}
}
}
}
原文:https://www.cnblogs.com/12141310lxlabc/p/15000454.html