码迷,mamicode.com
首页 >  
搜索关键字:ofstream    ( 221个结果
USCO--1.2Dual Palindromes
基本思路同上一题一样,改改上一题的代码就能过了代码如下:/* ID: 15674811 LANG: C++ TASK: dualpal */#include #include #include #include using namespace std;ofstream fout("dualpal.out"); ifstream...
分类:其他好文   时间:2015-03-06 22:17:28    阅读次数:182
USACO--1.2Palindromic Squares
水题,任意进制转换+回文判断 头脑不太清晰,代码写的很乱。。。。。代码如下:/* ID: 15674811 LANG: C++ TASK: palsquare */#include #include #include #include using namespace std;ofstream fout("palsquare.o...
分类:其他好文   时间:2015-03-06 19:14:53    阅读次数:134
文件操作
C++ 通过以下几个类支持文件的输入输出:ofstream: 写操作(输出)的文件类 (由ostream引申而来)ifstream: 读操作(输入)的文件类(由istream引申而来)fstream: 可同时读写操作的文件类 (由iostream引申而来)打开文件(Open a file)对这些类的...
分类:其他好文   时间:2015-03-06 19:00:10    阅读次数:135
USACO--1.1Greedy Gift Givers+模拟
简单模拟题。注意0%0是非法运算代码如下:/* ID: 15674811 LANG: C++ TASK: gift1 */#include #include #include #include #include using namespace std;int main() { ofstream fout("gi...
分类:其他好文   时间:2015-03-04 09:47:30    阅读次数:129
统计代码注释行的一些问题
1. 要统计一个c文件或者cpp文件里面的注释行,空行,总行数等,首先我们遇到的问题就是打开这个文件。ofstream: 写操作(输出)的文件类ifstream: 读操作(输入)的文件类fstream: 可同时读写操作的文件类这里我们只要读取文件里面的数据即可,所以选用ifstream.注意头文件(...
分类:其他好文   时间:2015-03-04 09:35:06    阅读次数:280
(转载)C++ ofstream和ifstream详细用法
[导读] ofstream是从内存到硬盘,ifstream是从硬盘到内存,其实所谓的流缓冲就是内存空间 在C++中,有一个stream这个类,所有的I/O都以这个“流”类为基础的,包括我们要认识的文件I/O. stream这个类有两个重要的运算符: 1、插入器(>) 从流中输入...
分类:编程语言   时间:2015-02-27 20:04:39    阅读次数:238
毕业设计
1.按逗号换行。#include#include#includeusing namespace std;int main(){ string s; ifstream ci("A.txt"); ofstream co("B.txt",ios::app); while(ci>>s...
分类:其他好文   时间:2015-02-27 20:02:32    阅读次数:159
刘汝佳算法竞赛入门经典 第二单元习题答案自编
欢迎交流讨论!@2-1#include using namespace std;ifstream fin("aplusb.in");ofstream fout("aplusb.out");int main(){ int n; while(fin>>n){ int count...
分类:编程语言   时间:2015-02-13 11:32:45    阅读次数:120
【c++笔记十三】c++中的输入、输出和文件操作
本文你将学到: 1.c++中基本IO、字符串IO和文件操作的方式,体验和c中这些操作的区别。 2.学会用面向对象(类)的思维去体会IO和文件操作。 3.认识istream ostream ifstream ofstream istringstream ostringstream fstream...
分类:编程语言   时间:2015-02-07 11:48:51    阅读次数:249
C++标准IO
cin(标准输入),cout(标准输出),cerr(不带缓存的标准错误输出),clog(带缓存的标准错误输出)。文件读写操作,分别为:ifstream(读文件),ofstream(写文件),fstream(读写文件)字符串作为输入输出流进行处理,分别为:istringstream(字符串输入流),o...
分类:编程语言   时间:2015-02-05 00:42:21    阅读次数:360
221条   上一页 1 ... 15 16 17 18 19 ... 23 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!