码迷,mamicode.com
首页 >  
搜索关键字:freopen    ( 1399个结果
输入输出优化
以下是输入测试: 1 #include<stdio.h> 2 const int N=1e8; 3 int main() 4 { 5 freopen("data.in","w",stdout); 6 for(int i=1;i<=N;i++) 7 printf("%d\n",i); 8 printf ...
分类:其他好文   时间:2016-05-02 14:20:15    阅读次数:179
以冒泡排序为例--malloc/free 重定向stdin stdout
esort.c 代码如下,可关注下mallloc/free,freopen重定向的用法,排序为每轮将最小的数放在最前面: 1 #include<stdio.h> 2 #include<malloc.h> 3 4 #define N 8 5 6 void datin(int *p); 7 void p ...
分类:编程语言   时间:2016-04-24 20:10:55    阅读次数:406
PAT1069. The Black Hole of Numbers
//这是到水题,之前因为四位数的原因一直不能A,看了别人的程序,才明白,不够四位的时候没考虑到,坑啊。。。。。脸打肿 #include<cstdio>#include<algorithm>using namespace std;int main(){ //freopen("input.txt","r
分类:其他好文   时间:2016-03-03 22:54:19    阅读次数:307
freopen()函数
freopen函数通过实现标准I/O重定向功能来访问文件,而fopen函数则通过文件I/O来访问文件。 freopen函数在算法竞赛中常被使用。在算法竞赛中,参赛者的数据一般需要多次输入,而为避免重复输入,使用重定向。 1 freopen 函数说明 2 3 函数名: freopen 4 功 能: 实
分类:其他好文   时间:2016-02-23 06:05:41    阅读次数:244
文件流的处理 C C++
C: 借鉴C 文件操作库函数总结 eg: #include <fstream> #include <iostream> #include <cstdio> using namespace std; int main(){ freopen("D:\\input.in","r",stdin); freo
分类:编程语言   时间:2016-02-11 00:32:24    阅读次数:209
【BZOJ 1877】 [SDOI2009]晨跑
带着 freopen提交会TLE....... 1 #include <cstdio> 2 #include <iostream> 3 #include <string> 4 #include <algorithm> 5 using namespace std; 6 #define N 100000
分类:其他好文   时间:2016-02-02 14:26:31    阅读次数:152
Cocos2d 使用控制台打印的方法
1.打开当前项目的win32解决方案。 2.在解决方案管理器的win32文件夹下打开main.cpp 3.增加以下代码: #define USE_WIN32_CONSOLE //以下加到入口函数 #ifdef USE_WIN32_CONSOLE AllocConsole(); freopen("CO
分类:其他好文   时间:2016-02-01 14:04:15    阅读次数:112
HDU 1064 Financial Management
很简单附代码 1 #include 2 #include 3 using namespace std; 4 5 6 int main() 7 { 8 double a=0; 9 double sum=0;10 //freopen("C:\\CODE\\in.txt",...
分类:其他好文   时间:2016-01-26 20:11:52    阅读次数:181
1.2.2 Transformations
A square pattern of size N x N (1 2 #include 3 #include 4 #include 5 using namespace std; 6 int main() 7 { 8 freopen("transform.in","r",stdin)...
分类:其他好文   时间:2016-01-24 22:20:38    阅读次数:148
文件重定向函数freopen
头文件:stdio.hFILE *freopen( const char *filename, const char *mode, FILE *stream );参数说明:filename:需要重定向到的文件名或文件路径。mode:代表文件访问权限的字符串。例如,"r"表示“只读访问”、"w"表示“...
分类:其他好文   时间:2016-01-18 20:45:39    阅读次数:214
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!