if语句判断是否为闰年
2021-10-12 本文已影响0人
哈迪斯Java
package HspLearning;
public class IfDay3 {
public static void main(String[] args) {
int year = 2050;
if((year%4 == 0 && year%100 != 0)||year%400 == 0) {
System.out.println(year + "是闰年");
}else{
System.out.println(year+"不是闰年");
}
}
}