这样写是不是复杂了点啊
for(int i=1;i<month;i++){
switch(i){
case 1:dday = 31;break;
case 3:dday = 31;break;
case 5:dday = 31;break;
case 7:dday = 31;break;
case 8:dday = 31;break;
case 10:dday = 31;break;
case 12:dday = 31;break;
case 2:dday = 28;break;
default: dday = 30;break;
}
sum +=dday;
}
if(year%400==0||(year%4==0&&year%100!=0)){
flag=1;
}else{
flag=0;
}
printf("%d年%d月%d日是该年的第%d天\n",year,month,day,sum=sum+day+flag);