大神看看这个continue
程序代码:
#include<stdio.h> #include<ctype.h> int main() { char a; printf("输入a的字符:"); while((a=getchar())!='#'); { if(a=='\n') continue; //这里出现了error C2044: illegal continue if(islower(a)) switch(a) { case'a':printf("aaaa\n");break; case'b':printf("bbbb\n");break; case'c':printf("cccc\n");break; default:printf("输入范围只在a~c\n"); } else printf("请输入小写字母\n"); while(putchar(a)!='\n') continue; printf("输入#结束\n"); } printf("buy\n"); return 0; }