题目:http://acm.hdu.edu.cn/showproblem.php?pid=2005
注意:闰年
查表法
#include<stdio.h>
int main()
{
int i,n;
int year,mouth,day;
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
while(scanf("%d/%d/%d",&year,&mouth,&day)!=EOF)
{
n=0;
for(i=1;i<mouth;i++)
n+=a[i];
n+=day;
if((year%4==0&&year%100!=0)||(year%400==0))
if(mouth>2)
n++;
printf("%d\n",n);
}
}