default:break 可以不写?
default:break;
default:break;
2016-01-10
int j; switch(month) { case 1:j=day;break; case 2:j=day+31;break; case 3:j=day+31+28;break; case 4:j=day+31+28+31;break; case 5:j=day+31+28+31+30;break; case 6:j=day+31+28+31+30+31;break; case 7:j=day+31+28+31+30+31+30;break; case 8:j=day+31+28+31+30+31+30+31;break; case 9:j=day+31+28+31+30+31+30+31+31;break; case 10:j=day+31+28+31+30+31+30+31+31+30;break; case 11:j=day+31+28+31+30+31+30+31+31+30+31;break; case 12:j=day+31+28+31+30+31+30+31+31+30+31+30;break; } if(year%100==0&&year%400==0||year%4==0&&year%100!=0) ( j++; ) printf("%d年%d月%d日是该年的第%d天",year,month,day,j); return 0;
举报