第十六周阅读程序-4

来源:互联网 发布:linux下编写python 编辑:程序博客网 时间:2024/06/05 00:46
/*copyright(c)2016.烟台大学计算机学院 * All rights reserved, * 文件名称:text.Cpp * 作者:刘涛 * 完成日期:2016年6月10日 * 版本号:vc++6.0 * 问题描述:阅读程序 */#include <iostream>#include <fstream>#include <cstdlib>using namespace std;int main( ){    int a;    ofstream outfile("f1.dat",ios::out);    if(!outfile)    {        cerr<<"open error!"<<endl;        exit(1);    }    cin>>a;    outfile<<a<<endl;    outfile.close();    return 0;}

运行结果:


0 0
原创粉丝点击