cin.get() 可以读一个字符, int get(); istream& get (char& c); 理论上应当可以读取回车。但c++通常用 '\n' 作为回车换行,所以读进来的是ASCII 码值 10, 也就是 '\n'。#include<iostream>using namespace std;int main(){ char c1,c2;c1=cin.get();c2=cin.get();cout<<"|"<<c1<<"|"<<c2<<"|"<<endl;return 0;} 拍入 x和回车(Enter 键),输出:|x||如果用 int c1,c2; 则输出 |120|10|。 10是 '\n' 的ASCII值。