用到C++的get()函数,不用在键盘上敲击Ctrl+Z,输入结束直接回车即可结束输入 具体代码如下: #include <iostream> using namespace std; int main(){ int b = 0; char c; while ((cin