C语言代码:
2005 c
[code]
#include<stdio.h>
int main()
{
int year,month,day;
int i;
int num=0;
int d[12]={31,28,31,30,31,30,31,31,30,31,30,31};
while(scanf("%d/%d/%d",&year,&month,&day)!=EOF)
{
if (year%4==0&&year%100!=0||year%400==0)
d[1]=29;
else
d[1]=28;
for(i=0;i<month-1;i++)
num+=d[i];
num+=day;
printf("%d\n",num);
num=0;
}
return 0;
}
[/code]