码迷,mamicode.com
首页 >  
搜索关键字:stdin    ( 2699个结果
hdu1730Northcott Game NIM博弈
//必胜局面是所有的黑子和白子都相邻, //本题想要达到黑子和白子之间都相邻,即走完它们之间的所有空格 //就相当于一个NIM博弈 #include #include #include using namespace std ; int main() {    // freopen("in.txt","r",stdin) ;     int n , m ;     int t...
分类:其他好文   时间:2015-04-11 14:54:50    阅读次数:111
USACO--3.1Score Inflation+完全背包问题
就是一简单的完全背包问题,秒杀。代码如下:/* ID:15674811 LANG:C++ PROG:inflate */#include #include #include using namespace std;#define maxn 11000int main() { freopen("inflate.in","r",stdin);...
分类:其他好文   时间:2015-04-10 18:05:59    阅读次数:176
Nodejs随笔(三):全局对象之process
process是全局对象,在任何地方都可以访问,而且它是EventEmitter的一个实例(关于EventEmitter后面会提到)。process对象对一些标准的输入输出流进行了封装,如stdin(标准输入)、stdout(标准输出)和stderr(标准错误输出)。其中,stdin和stdout支...
分类:Web程序   时间:2015-04-05 16:00:22    阅读次数:201
freopen()重定向的打开和关闭
例如,想打开“in.txt”,执行如下操作即可 打开:freopen("in.txt", "r", stdin)                     //读模式 打开:freopen("in.txt", "w", stdin)                     //写模式 其实令人最头疼的不是这些,而是一旦重定向打开之后,不关闭的话就很痛苦了,但是还是让我找到了...
分类:其他好文   时间:2015-04-04 18:30:21    阅读次数:332
CodeForce-245B-Internet Address
主要涉及字符串操作#include #include using namespace std;int main(){ freopen("input.txt","r",stdin); string str; string str2("ru"); while(cin>>str) { int len=str.si...
分类:Web程序   时间:2015-04-04 16:49:55    阅读次数:149
PAT B1032 挖掘机技术哪家强(20)(模拟)
【思路】:模拟。不需要结构体,用数组记录就可以。注意,题目中说了学校“从1开始连续编号”。 【AC代码】: #include #include using namespace std; const int maxn = 100000+10; int school[maxn]; int main() { //freopen("in.txt", "r", stdin); int n =...
分类:其他好文   时间:2015-04-04 09:14:50    阅读次数:128
fgets()读取\n的问题发现
fgets()函数会读取\n,把\n放到字符串里去,但是我发现也可以不让它把\n放进去程序代码:# includeintmain(void){charstr[7]; fgets(str,7,stdin);//输入:12345,预留2个字符的空间,一个放\n,一个放\0 fputs(str,stdou...
分类:其他好文   时间:2015-04-03 17:17:54    阅读次数:570
fopen和freopen
经常会遇到文件操作,这时,从文件输入和输出到文件不可少。 freopen函数用来重定向输入和输出,不过这个函数有个缺点:只能输入和输出只能定向到一个文件,比如fp1=freopen("data1,in", "r", stdin);fp2=freopen("data2,in", "r", stdin);输入都会变成从data2.in中输入。 而fopen函数可以方便实现从几个文件中读取函数,相应...
分类:其他好文   时间:2015-04-03 09:18:13    阅读次数:112
UVA_445:Marvelous Mazes
Language:C++ 4.8.2#include#include#includeint main(void){ char str[140]; int sum; while(1) { if(fgets(str, sizeof(str), stdin) == N...
分类:其他好文   时间:2015-04-02 20:47:02    阅读次数:182
[河南省ACM省赛-第三届] 聪明的kk (nyoj 171)
#include #include #include #include #include using namespace std; #define INF 0x7fffffff #define INPUT freopen("d:\\in.txt", "r", stdin); #define OUTP...
分类:其他好文   时间:2015-04-01 21:36:26    阅读次数:184
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!