码迷,mamicode.com
首页 >  
搜索关键字:freopen    ( 1399个结果
c++随机数据生成器
这是随机数据生成器,可以在noi上检测。。。。。。#include<iostream> #include<time.h> #include<cstdio> #include<stdlib.h> usingnamespacestd; intmain() { freopen("random.txt","w",stdout); longlonga,b,n,cou;//cou:数据个数; cin>>..
分类:编程语言   时间:2015-11-01 06:57:26    阅读次数:250
usaco Feed Ratios
用三种营养成分不同的饲料,凑成精确比例营养的饲料。数据范围比较小,单纯枚举就能过。/*ID: modengd1PROG: ratiosLANG: C++*/#include #include using namespace std;int main(){ freopen("ratios.in"...
分类:移动开发   时间:2015-09-20 01:41:58    阅读次数:190
二分法求三次方程的根
二分法求根#include "stdio.h"#define f(x) a*x*x*x+b*x*x+c*x+dint main(){ freopen("in.txt", "r", stdin); int a, b, c, d; double x1, x2, x, y1, y2, y...
分类:其他好文   时间:2015-09-14 08:15:41    阅读次数:278
USACO 1.3 Ski Course Design
Ski Course DesignFarmer John has N hills on his farm (1 #include #include using namespace std;int main(){ freopen("skidesign.in","r",stdin); fre...
分类:其他好文   时间:2015-09-09 06:11:06    阅读次数:179
文件操作 输入
使用文件最简单的方法 使用输入输出重定向freopen("input.text", "r", stdin);freopen("output.text", "w", stdout);FILE*fin, *fout;fin = fopen("data.in", "rb");//外界从其中读取数据fout...
分类:其他好文   时间:2015-09-08 18:35:01    阅读次数:174
freopen()函数测试数据
当我们求解acm题目时,通常在设计好算法和程序后,要在调试环境(例如VC等)中运行程序,输入测试数据,当能得到正确运行结果后,才将程序提交到oj中。但由于调试往往不能一次成功,每次运行时,都要重新输入一遍测试数据,对于有大量输入数据的题目,输入数据需要花费大量时间。 使用freopen函数可以解决测试数据输入问题,避免重复输入,不失为一种简单而有效的解决方法。 函数名:freopen...
分类:其他好文   时间:2015-08-31 01:15:46    阅读次数:192
hdu1050
#include #include using namespace std; int n; int arr[410]; void f(int x,int y) { for(int i=x;i } int main() { freopen("in1.txt","r",stdin); int i; cin>>n; while(n) { n--; memset(...
分类:其他好文   时间:2015-08-30 17:36:16    阅读次数:205
Codeforces Round #318 (Div. 2) C Bear and Poker
很简单,求一下所有数的2和3的幂是任意调整的,把2和3的因子除掉以后必须相等。#includeusing namespace std;typedef long long ll;const int maxn = 1e5+5;ll a[maxn];int main(){ //freopen("in...
分类:其他好文   时间:2015-08-30 09:53:19    阅读次数:190
质数筛 nbut1454 Lux
传送门:点击打开链接 题意:给出区间[L,R],R-L 思路:筛[L,R]区间中的全部质数,然后再遍历一遍 #include #include #include #include #include #include #include #include #include #include #include #include #define FIN freopen("input.txt","r"...
分类:其他好文   时间:2015-08-25 23:49:16    阅读次数:118
UVA - 12263 Rankings 模拟(拓扑排序)
1 #pragma comment(linker, "/STACK:1000000000") 2 #include 3 #define LL long long 4 #define INF 0x3f3f3f3f 5 #define IN freopen("E.in","r",stdin...
分类:编程语言   时间:2015-08-18 18:42:07    阅读次数:128
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!