Chinaunix首页 | 论坛 | 博客
  • 博客访问: 307524
  • 博文数量: 214
  • 博客积分: 4258
  • 博客等级: 上校
  • 技术积分: 2021
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-02 09:16
个人简介

http://blog.csdn.net/ly21st http://ly21st.blog.chinaunix.net

文章分类

全部博文(214)

文章存档

2018年(16)

2015年(1)

2014年(2)

2012年(22)

2011年(173)

发布时间:2011-11-21 10:00:22

问题描述: 从文件读取数据,并输出到终端。 #include <iostream>#include <string>#include <stdexcept>#include <fstream>using namespace std;istream& get(istream &in){   string word;   while(in>>word,!in.eof()) {      if(in.bad())&n.........【阅读全文】

阅读(196) | 评论(0) | 转发(0)

发布时间:2011-11-20 19:20:28

#include <istream>#include <iostream>using namespace std;#include <string>#include <stdexcept>/**回复流状态之后要清空缓冲区,不然还是读取你最近一次输入的错误数据,在cin >> n之前加入如下代码:C/C++ codeif(!cin.good()) { cin.clear(); cin.sync();//清空缓冲区 }*/ &.........【阅读全文】

阅读(614) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册