24 lines
522 B
C
24 lines
522 B
C
/*-------------------------------------------------------
|
||
编写程序,输出从公元2000年至3000年所有闰年的年号,每输出10个年号换一行。
|
||
-------------------------------------------------------*/
|
||
#include <stdio.h>
|
||
main()
|
||
{
|
||
int year,count;
|
||
count=0;
|
||
for(year=2000;year<=3000;year++)
|
||
{
|
||
if(year%4==0&&year%100!=0 || year%400==0) {
|
||
printf("%-6d",year);
|
||
/**********Program**********/
|
||
count++;
|
||
if(count%10==0){
|
||
printf("\n");
|
||
}
|
||
}
|
||
/********** End **********/
|
||
}
|
||
}
|
||
|
||
|