求助
一个一年中第几天的算法#include <stdio.h>
int main()
{
int day,year,month,i;
int daymonth[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
if (year%4==0&&year%100!=0||year%400==0)
{
daymonth[2]=29;
}
while(scanf("%d/%d/%d",&year,&month,&day))
{
for(i=0;i<month;i++)
day+=daymonth[i];
printf("%d",day);
printf("\n");
}
return 0;
}
怎么不对??2006/3/12应该输出71,而我输出了72,怎么回事呢,请高手指点