第16周项目——阅读程序4
2016-06-19 16:30
253 查看
问题及代码:
/*copyright(c)2016.烟台大学计算机学院
* All rights reserved,
* 文件名称:text.Cpp
* 作者:李一波
* 完成日期:2016年6月19日
* 版本号:codeblocks
*
* 问题描述:
* 输入描述:
* 程序输出:
*/
#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;
}
运行结果:
/*copyright(c)2016.烟台大学计算机学院
* All rights reserved,
* 文件名称:text.Cpp
* 作者:李一波
* 完成日期:2016年6月19日
* 版本号:codeblocks
*
* 问题描述:
* 输入描述:
* 程序输出:
*/
#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;
}
运行结果:
相关文章推荐
- ios 通过一个View生成一个图片
- 实用工具网站(经纬度、短链接、图片格式转换、长微博、图片压缩、uuid、繁体字)
- 再谈协方差矩阵之主成分分析
- GitHub安装及配置,上传项目到github
- PHP的常量
- bash编程总结
- 机房收费系统问题(二)——MDI子窗体不显示
- CSS 链接
- Spring4.x Jpa + hibernate的配置(废弃JpaTemplate)
- js反柯里化
- 《剑指offer》:[42-1]左旋转字符串
- codeforces 682 C
- js实现工厂模式
- Pyinstaller : ImportError: No module named pefile
- Ubuntu12.04lts下加装Windows双系统
- HDU4730 We Love MOE Girls
- Leetcode Best Time to Buy and Sell Stock
- FND_MESSAGE_PUB.get及error_handler.get_message用法
- 分布式系统中的定时任务全解(三)
- Python-第三方库requests详解