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+"不是闰年");
}
}
}
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+"不是闰年");
}
}
}
本文标题:if语句判断是否为闰年
本文链接:https://www.haomeiwen.com/subject/fjsjoltx.html
网友评论