我去··这错了吗?
#include "stdio.h"int main()
{
char ch;
printf("1.Morning\n");
printf("2.Afternoon\n");
printf("3.Evening\n");
printf("Input your choose:");
ch=getchar();
switch(ch);
{
case'1':printf("Good Morning!");break;
case'2':printf("Good Afternoon!");break;
case'3':printf("Good Evening!");break;
default:printf("Slection Wrong!");
}
return 0;
}
--------------------Configuration: 12 - Win32 Debug--------------------
Compiling...
.c
D:\360Windows7\Microsoft Visual Studio\MyProjects\12\.c(12) : error C2046: illegal case
D:\360Windows7\Microsoft Visual Studio\MyProjects\12\.c(12) : error C2043: illegal break
D:\360Windows7\Microsoft Visual Studio\MyProjects\12\.c(13) : error C2046: illegal case
D:\360Windows7\Microsoft Visual Studio\MyProjects\12\.c(13) : error C2043: illegal break
D:\360Windows7\Microsoft Visual Studio\MyProjects\12\.c(14) : error C2046: illegal case
D:\360Windows7\Microsoft Visual Studio\MyProjects\12\.c(14) : error C2043: illegal break
D:\360Windows7\Microsoft Visual Studio\MyProjects\12\.c(15) : error C2047: illegal default
执行 cl.exe 时出错.
12.exe - 1 error(s), 0 warning(s)