while((ch=getchar())!='\n')是什么意思RT.
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/04 23:01:54
![while((ch=getchar())!='\n')是什么意思RT.](/uploads/image/z/6847984-64-4.jpg?t=while%28%EF%BC%88ch%3Dgetchar%28%29%29%21%3D%27%5Cn%27%EF%BC%89%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9DRT.)
while((ch=getchar())!='\n')是什么意思RT.
while((ch=getchar())!='\n')是什么意思
RT.
while((ch=getchar())!='\n')是什么意思RT.
这样就表示你输入回车就跳出循环
这段代码解析为
将getchar()读取键盘输入的值赋给ch,然后在判断ch !='\n'
你看一下括号配对也可以理解了