关于c语言for循环break的使用代码如下:为什么输入n也不好使?还循环两次.Do you want to enter some more(y/n):yDo you want to enter some more(y/n):Do you want to enter some more(y/n):yDo you want to enter some more(y/n):Do you w
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/09 00:14:01
关于c语言for循环break的使用代码如下:为什么输入n也不好使?还循环两次.Do you want to enter some more(y/n):yDo you want to enter some more(y/n):Do you want to enter some more(y/n):yDo you want to enter some more(y/n):Do you w
关于c语言for循环break的使用
代码如下:
为什么输入n也不好使?还循环两次.
Do you want to enter some more(y/n):y
Do you want to enter some more(y/n):Do you want to enter some more(y/n):y
Do you want to enter some more(y/n):Do you want to enter some more(y/n):y
Do you want to enter some more(y/n):Do you want to enter some more(y/n):y
Do you want to enter some more(y/n):Do you want to enter some more(y/n):y
Do you want to enter some more(y/n):Do you want to enter some more(y/n):y
Do you want to enter some more(y/n):Do you want to enter some more(y/n):y
Do you want to enter some more(y/n):Do you want to enter some more(y/n):y
Do you want to enter some more(y/n):Do you want to enter some more(y/n):y
Do you want to enter some more(y/n):Do you want to enter some more(y/n):
在scanf和if之间加上函数getchar();
就好了.但为什么
在输入很多e之后,在输入n就退步出来了?
关于c语言for循环break的使用代码如下:为什么输入n也不好使?还循环两次.Do you want to enter some more(y/n):yDo you want to enter some more(y/n):Do you want to enter some more(y/n):yDo you want to enter some more(y/n):Do you w
清空一下缓冲区就可以了
printf("Do you want to enter some more(y/n):");fflush(stdin);
scanf("%c", &answer);
...