public class LeapYearFor {
static boolean isLeapYear(int year){
if((year%4==0&&year%100!=0)||year%400==0)
return true;
else
return false;}
public static void main(String args[]){
for(int i=1800;i<=2014;i++){
if(isLeapYear(i)){
System.out.print(" "+i);
}
}
}
}
01-11
07-14
06-23
06-23
06-23
06-23
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交