第十六周实践项目之阅读程序————4

来源:互联网 发布:国内域名和国际域名 编辑:程序博客网 时间:2024/05/22 10:48

问题及代码:

/*copyright(c)2016.烟台大学计算机学院 * All rights reserved, * 文件名称:text.Cpp * 作者:吴敬超 * 完成日期:2016年6月13日 * 版本号:codeblock * * 问题描述: * 输入描述: * 程序输出: 输出结果 */ #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
原创粉丝点击