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);
}
}
}
}
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);
}
}
}
}
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。