码迷,mamicode.com
首页 >  
搜索关键字:stdin    ( 2699个结果
HDU 5090 Game with Pearls
直接贪心就可以了,接收的时候把0都加上k,每次从最小的数开始找,如果有多个相同的,那么保留一个,其他的都加上k #include #include using namespace std; int a[105]; int main(){ #ifndef ONLINE_JUDGE freopen("in.txt","r",stdin); #endif int T,n,k; scanf("...
分类:其他好文   时间:2015-05-02 23:24:48    阅读次数:170
Linux中的三个特殊文件
stdin: 0 标准输入 stdout: 1 标准输出 stderr : 2 标准错误输出 /dev/null 表示一个只写文件。所有写入到这个文件的信息都会丢失
分类:系统相关   时间:2015-05-02 17:58:25    阅读次数:119
HDU 2176 (Nim博弈 先手取胜方案) 取(m堆)石子游戏
切切水题,放松心情:-D 1 #include 2 3 const int maxn = 200000 + 10; 4 int a[maxn]; 5 6 int main() 7 { 8 //freopen("in.txt", "r", stdin); 9 10 int m;1...
分类:其他好文   时间:2015-04-28 16:04:14    阅读次数:104
myshell.c
#include #include #include #include #include #define MAXLINE 4096 int main(void) { char buf[MAXLINE]; pid_t pid; int status; printf("%% "); while(fgets(buf,MAXLINE,stdin) != NULL) { ...
分类:系统相关   时间:2015-04-26 19:49:58    阅读次数:283
getcin_to_putcout.c
#include #include int main(void) { int c; while((c = getc(stdin)) != EOF) if(putc(c,stdout) == EOF){ printf("output error\n"); exit(1); } if(ferror(stdin)) { printf("input error\...
分类:其他好文   时间:2015-04-26 13:57:03    阅读次数:137
stdin_to_stdout.c
#include #include #include #define BUFFSIZE 4096 int main(void) { int n,m; char buf[BUFFSIZE] = {0}; while((n = read(STDIN_FILENO, buf, BUFFSIZE)) > 0){ if(m = write(STDOUT_FILENO, buf, BU...
分类:其他好文   时间:2015-04-26 09:19:21    阅读次数:97
Ubuntu 14.04.2 root登陆报错解决方案
root 登陆报错 stdin: is not a tty
分类:系统相关   时间:2015-04-25 19:40:14    阅读次数:230
Linux下清空缓冲区的方法
Linux下清空缓冲区的方法 C标准规定fflush()函数是用来刷新输出(stdout)缓存的。对于输入(stdin),它是没有定义的。但是有些编译器也定义了fflush( stdin )的实现,比如微软的VC。其它编译器是否也定义了fflush( stdin )的实现应当查找它的手册。 ...
分类:系统相关   时间:2015-04-24 18:42:04    阅读次数:330
perl: 输入输出
输入和输出:   操作符:用来从STDIN读入数据: 如果读到文件结尾行输入符就会返回undef.   $line = ;    #读取下一行. chomp($line =);    #去掉输入的一行的最后的换行符 while () {     print “$_”; } foreach () {     print “$_”; }   print函数:用来将信息...
分类:其他好文   时间:2015-04-23 17:27:52    阅读次数:135
HDU 1029 Ignatius and the Princess IV
水题啊,说好的dp呢 刚开始的想法是hash,但题目数据范围没给出来。一直在想怎么用dp 然后看了看解题报告,解法太简单了,因为一定有某数出现次数比其他所有的数出现次数加起来都大,所以用个计数器互相抵消就可以了。 #include int main(){ #ifndef ONLINE_JUDGE freopen("in.txt","r",stdin); #endif int n; ...
分类:其他好文   时间:2015-04-23 15:46:21    阅读次数:173
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!