标签:
1 #include<stdio.h> 2 int main(){ 3 int year,mouth,day; 4 while(scanf("%d/%d/%d",&year,&mouth,&day)!=EOF){ 5 int i=0; 6 switch(mouth-1){ 7 case 11:i+=30; 8 case 10:i+=31; 9 case 9:i+=30; 10 case 8:i+=31; 11 case 7:i+=31; 12 case 6:i+=30; 13 case 5:i+=31; 14 case 4:i+=30; 15 case 3:i+=31; 16 case 2:if(year%400==0||(year%4==0&&year%100!=0)) 17 i+=29;else 18 i+=28; 19 case 1:i+=31; 20 } 21 printf("%d\n",i+day); 22 } 23 return 0; 24 }
标签:
原文地址:http://www.cnblogs.com/isole/p/5774467.html