程序代码:
#include <stdio.h> #include <conio.h> int main(void) { int year; for(year = 2000; year <= 2500; year++) { if((0 == year % 4 && 0 != year % 100) || (0 == year % 400)) printf("%d 是闰年\n", year); else printf("%d 不是闰年\n", year); if((year + 1 - 2000) % 23 == 0) getch(); } return 0; }
Only the Code Tells the Truth K.I.S.S