public class year{
public static void main(String[] args){
boolean bool = isRunYear(2008);
if(bool){
System.out.println("是闰年");
}else{
System.out.println("是平年");
}
}
public static boolean isRunYear(int year){
if((year%4==0 && year%100!=0)||year%400==0){
return true;
}else{
return false;
}
}
}
判断平年还是闰年
最新推荐文章于 2021-07-06 22:36:45 发布