题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2005
题目大意:水题,注意平年和闰年的判断~
1 #include <stdio.h> 2 int main () 3 { 4 int sum,i,y,m,d,num[13]= {0,31,28,31,30,31,30,31,31,30,31,30,31}; 5 while (scanf("%d/%d/%d",&y,&m,&d)!=EOF) 6 { 7 sum=0; 8 for (i=0; i<m; i++) 9 sum+=num[i]; 10 sum+=d; 11 if ((m>2)&&(y%400==0)||(y%100!=0)&&(y%4==0)) 12 sum+=1; 13 printf ("%d ",sum); 14 } 15 return 0; 16 }