标签:
1 #include<stdio.h> void main() { 2 int year, leap; 3 scanf("%d",&year); 4 if (year%4==0) { if (year%100==0) { if (year%400==0) leap=1; 5 6 7 else leap=0; 8 } 9 else leap=1; } 10 11 else leap=0; 12 if (leap) printf("%d is ",year); else printf("%d is not ",year); 13 14 printf("a leap year.\n"); }
输入 2000
输入 1999
输入 1996
输入 1900
标签:
原文地址:http://www.cnblogs.com/EdenSun/p/4396981.html