这个多组数据的输入,第一组数据总是正确的,但是第二组就不对了,不知道为什么
#include<stdio.h>int main()
{
int year,month,day,s=0,i,d;
while(scanf("%d/%d/%d",&year,&month,&day)!=EOF){
int m[14]={0,31,28,31,30,31,30,31,31,30,31,30,31};
if(year%4==0&&year%100!=0||year%400==0)
m[2]=29;
else
m[2]=28;
for(i=0;i<month;++i)
{
s=s+m[i];
}
d=s+day;
printf("%d\n",d);
}
}