2025-03-06 12:46:40 +08:00

24 lines
522 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
编写程序输出从公元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 **********/
}
}