qq_慕无忌8081688
2019-04-24 19:26
#include <stdio.h>
int main()
{
int year,month,day,number ;
year=2008;
month=8;
day=8;
switch(month)
{
case 1:
number =31;
printf("%d",number );
case 2:
if ((year%4==0&&year%100!=0)||year%400==0)
{
number =number +29;
printf ("%d",number );
}
else
{
number=number+28;
printf ("%d",number );
}
case 3:
number+=31;
printf ("%d ",number );
case 4:
number+=30;
printf ("%d",number );
case 5:
number+=31;
printf ("%d",number );
case 6:
number+=30;
printf ("%d",number );
case 7:
number+=31;
printf ("%d",number );
case 8:
number+=day;
printf ("%d",number );
break ;
default :
printf ("A");
break ;
}
printf ("%d",number );
return 0;
}
前几个case都没有用break跳出
C语言入门
926024 学习 · 20793 问题
相似问题
回答 4
回答 2
回答 3
回答 3
回答 3