if( year%4 == 0 && month > 2 )
flag = 1;
else
flag = 0;
switch( month )
{
case 1:sum=day+flag;break;
case 2:sum=day+flag+31;break;
case 3:sum=day+flag+59;break;
case 4:sum=day+flag+89;break;
case 5:sum=day+flag+120;break;
case 6:sum=day+flag+150;break;
case 7:sum=day+flag+181;break;
case 8:sum=day+flag+211;break;
case 9:sum=day+flag+242;break;
case 10:sum=day+flag+272;break;
case 11:sum=day+flag+303;break;
case 12:sum=day+flag+333;break;
}
printf("%d年%d月%d日是该年的第%d天\n",year,month,day,sum);
return 0;
}
case里面犯了逻辑错误 只有2月才加1