qq_后现代_0
2015-08-18 16:59
int sum;
swtich(month)
{
case 1:sum=0;break;
case 2:sum=28;break;
case 3:sum=(28+31);break;
case 4:sum=(28+31+30);break;
case 5:sum=(28+31+30+31);break;
case 6:sum=(28+31+30+31+30);break;
case 7:sum=(28+31+30+31+30+31);break;
case 8:sum=(28+31+30+31+30+31+31);break;
case 9:sum=(28+31+30+31+30+31+31+30);break;
case 10:sum=(28+31+30+31+30+31+31+30+31);break;
case 11:sum=(28+31+30+31+30+31+31+30+31+30);break;
case 12:sum=(28+31+30+31+30+31+31+30+31+30+31);break;
default: ;
}
if(year%400==0||(year%400!=0&&year%4==0))
{
sum=sum+day+1;
printf("%d年%d月%d日是该年的第%d天",year,month,day,sum);
}
else
{
sum=sum+day;
printf("%d年%d月%d日是该年的第%d天",year,month,day,sum);
}
return 0;
}
报错信息,贴出来看看?
switch写错了,你写的是swtich
C语言入门
926207 学习 · 20797 问题
相似问题