char a; cin >> a; while(!cin.fail()) { // Do some thing... } cin在读取输入流的末尾是会设置标记位failbit为非零,cin.fail();值不为0
12-20
1097
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-17
3075
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-31
1903
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-29
479
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)