Files
class-notes/2207/天天乐学答案/C语言/C语言(三)/8.c
T
2025-03-06 12:46:40 +08:00

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 **********/
}
}