能被4整除并且不能被一百整除或者能被四百整除
public boolean isLeapYear(){
boolean flag = (year%4==0&&year%100!=0)||year%400==0;
String msg = flag ?year+"是闰年":year+"不是闰年";
System.out.println(msg);
return flag;
}
能被4整除并且不能被一百整除或者能被四百整除
public boolean isLeapYear(){
boolean flag = (year%4==0&&year%100!=0)||year%400==0;
String msg = flag ?year+"是闰年":year+"不是闰年";
System.out.println(msg);
return flag;
}