标签:sys rgs string int static ati [] r++ 不能
public static void main(String args[]){
for(int year=1999;year<2999;year++){
if(year%4==0 && year%100!=0 || year%400){
System.out.println(year);
}
}
}
判断读入的年份是否为闰年,并输出1999~2999年中所有的闰年。 判断闰年的方法:能被4整除,但不能被100整除;或可以被400整除。
标签:sys rgs string int static ati [] r++ 不能
原文地址:http://www.cnblogs.com/chenligeng/p/7616212.html