A.geometry#include#include#include#include#includeusing namespace std;int main(){ //freopen("in.txt","r",stdin); int T;scanf("%d",&T); while(...
分类:
其他好文 时间:
2016-01-03 00:39:15
阅读次数:
278
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
intfun()
{
intch;
intret=0;
while(isdigit(ch=getchar()))
{
ret=ret*10+ch-48;
}
ungetc(ch,stdin);
returnret;
}
voidfun1()
{
intch;
intret=fun();
printf("%d\n",ret);
ch=getchar();
putc..
分类:
其他好文 时间:
2015-12-28 20:39:38
阅读次数:
172
批量建账号脚本:#!/bin/bashUser=/root/user.txtforNamein`cat$User`doecho$Nameuseradd$Nameecho‘redhat‘|passwd--stdin$Namedone:wq在user.txt里写入多个账号名即可(竖排写)echo‘redhat‘|passwd--stdin$Name是设置账号密码为redhat的意思,相当于passwd$Name输入redhat
分类:
其他好文 时间:
2015-12-27 16:22:26
阅读次数:
124
Node.js 多进程我们都知道 Node.js 是以单线程的模式运行的,但它使用的是事件驱动来处理并发,这样有助于我们在多核 cpu 的系统上创建多个子进程,从而提高性能。每个子进程总是带有三个流对象:child.stdin, child.stdout 和child.stderr。他们可能会共享父...
分类:
Web程序 时间:
2015-12-22 17:52:44
阅读次数:
272
重定向 shell编辑文本 图形化工具编辑文件 1、重定向 标准输入 标准输出 错误输出 [root@sky kkk]# cat aaa.sh #!/bin/bash a=1 while [ $a -le 5 ] do useradd user$a let a++ done [root@sky kk...
分类:
系统相关 时间:
2015-12-22 16:16:39
阅读次数:
334
在学习Linux的过程中,常会看到一些终端命令或者程序中有">/dev/null 2>&1 "出现,由于已经遇到了好几次了,为了理解清楚,不妨花点时间百度或者google一下相关的知识。0:表示键盘输入(stdin)1:表示标准输出(stdout),系统默认是12:表示错误输出(stderr)com...
分类:
系统相关 时间:
2015-12-21 17:49:08
阅读次数:
196
#include#define REP(i,a,b) for(int i=a;i q;int main(){ freopen("in.txt","r",stdin); while(cin>>n>>d,n||d){ REP(i,1,n) scanf("%1d",&a[i]);...
在Linux下,使用gets(cmd)函数报错:warning: the 'gets' function is dangerous and should not be used.解决办法:采用fgets(cmd,100,stdin);//100为size问题解决!fgets从stdin中读字符,直至...
分类:
编程语言 时间:
2015-12-15 00:41:33
阅读次数:
360
run 在docker中表示运行容器:常数列表名称用途例子-a, --attach=[]指定标准输入输出内容类型,可选STDIN/STDOUT/STDERR三项;-d, --detach=false后台运行容器,并返回容器ID;-i, --interactive=false以交互模式运行容器,通常与...
分类:
其他好文 时间:
2015-12-14 16:21:41
阅读次数:
178
由来: 当我们执行一个指令时,可能会访问档案和执行一些讯息后将一些信息显示到屏幕上,而重定向就是将如此的的讯息导向到其他文件中,事实上,默认的其实就是数据导向到屏幕文件,只是将其重定向到你指定的文件中输入输出方式: 标准输入 (stdin):代码为0,使用(覆盖式标准输出)或>>(累加式标准输...
分类:
其他好文 时间:
2015-12-10 19:32:08
阅读次数:
148