在C语言的学习中,我学习到switch case语句,我发现不能使用continue关键字。
代码如下:
#include <stdio.h>
int main()
{
int a;
printf("input integer number: ");
scanf("%d",&a);
switch (a)
{
case 1:printf("Monday\n");
case 2:printf("Tuesday\n");
case 3:printf("Wednesday\n");
case 4:printf("Thursday\n");
continue;
case 5:printf("Friday\n");
case 6:printf("Saturday\n");
case 7:printf("Sunday\n");
default:printf("error\n");
}
return 0;
}
此代码会出现如下错误: