hdu2005 不知道为什么是wrong answer
#include<stdio.h>bool is_run(int year){
if((year%4==0&&year%100!=0)||(year%400==0))
return true;
else
return false;
}
int main(){
int year,month,day;
int day0;
while(scanf("%d/%d%/%d",&year,&month,&day)!=EOF){
switch(month){
case 1:
day0=0;
break;
case 2:
day0=31;
break;
case 3:
day0=59;
break;
case 4:
day0=90;
break;
case 5:
day0=120;
break;
case 6:
day0=151;
break;
case 7:
day0=181;
break;
case 8:
day0=212;
break;
case 9:
day0=243;
break;
case 10:
day0=273;
break;
case 11:
day0=304;
break;
case 12:
day0=334;
break;
}
day0=day0+day;
if(is_run(year))
day0=day0+1;
printf("%d\n",day0);
}
return 0;
}