/*
* Copyright (c) 2012, 烟台大学计算机学院
* All rights reserved.
* 文件名称:test.cpp
* 作者:樊露露
* 完成日期:2012 年11月10日
* 版本号:v1.0
*
* 输入描述:无
* 问题描述:将数据“写入、输出”到文件中
* 程序输出:将数据输出
* 问题分析:
* 算法设计:略
*/
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
char c;
ofstream outfile("haha.dat",ios::out);
if(!outfile){
cerr<<"open error!"<<endl;
exit(1);
}
for(;(c=getchar())!='\n';){
outfile<<c;
}
outfile.close();
cout<<"处理完毕,请打开文件查看结果!"<<endl;
return 0;
}
心得体会:
警报解除。