/* Note:Your choice is C IDE */ #include "stdio.h" void main() { int year,leap; scanf("%d",&year); if (year%4==0) { if (year%100==0) { if (year%400==0) leap=1; else leap=0; } else leap=1; } else leap=0; if(leap) printf("%d is",year); else printf("%d is not",year); printf("a leap year.\n");
printf("ID:2013914119"); }
总结:闰年的判断条件有多个,不要遗漏。