#include#include#includeusing namespace std;const int N=50;int c1[N+10],c2[N+10],num[30];int main(){ //freopen("read.txt","r",stdin); int t; scanf("%d...
                            
                            
                                分类:
其他好文   时间:
2015-01-29 13:59:04   
                                阅读次数:
158
                             
                         
                    
                        
                            
                            
                                这是我的第一篇关于UNIX环境高级编程的日志,使用g++编译libapue.a #include "apue.h" #define BUFFSIZE 4096 int main()
{ int n; char buf[BUFFSIZE]; while ((n = read(STDIN_FILENO,...
                            
                            
                                分类:
其他好文   时间:
2015-01-28 21:10:57   
                                阅读次数:
115
                             
                         
                    
                        
                            
                            
                                2015.1.27星期二,早晨阴天,中午下雪了今天上午老师不上课,程序语句,记一下:main(void){	int c;	while((c = getc(stdin)) != EOF) if(putc(c,stdout) == EOF) 将字符写到标准输出 err_sys("output ...
                            
                            
                                分类:
其他好文   时间:
2015-01-27 23:28:32   
                                阅读次数:
220
                             
                         
                    
                        
                            
                            
                                1.CodeForces 92A给一堆围成圈的小朋友发饼干,小朋友为1~n号,第几号小朋友每次拿多少块饼干,问最后剩多少饼干#include #include using namespace std;int main(){ // freopen("a.in" , "r" , stdin); ...
                            
                            
                                分类:
其他好文   时间:
2015-01-27 18:02:07   
                                阅读次数:
163
                             
                         
                    
                        
                            
                            
                                昨天主要了解了下生成器,用文档测下lines:
def lines(file):
    for line in file: yield line
yield '\n'
for i in lines(sys.stdin):
	if i:
		print i
		print '---'
测试文档test_input.txt:
hello
how are you
how do you...
                            
                            
                                分类:
编程语言   时间:
2015-01-25 15:19:43   
                                阅读次数:
206
                             
                         
                    
                        
                            
                            
                                processLine()
{
line="$@"
echo $line
}
 
FILE=""
 
if [ "$1" == "" ]; then
    FILE="/dev/stdin"
else
    FILE="$1"
 
    if [ ! -f $FILE ]; then
        echo "$FILE : does not exists"
        exit 1
...
                            
                            
                                分类:
系统相关   时间:
2015-01-23 20:07:29   
                                阅读次数:
242
                             
                         
                    
                        
                            
                            
                                #include #include struct N{ int c; int e;}buf[1010],ans[1010];int main(){ freopen("data.in","r",stdin); freopen("d1.out","w",stdout); int x,y...
                            
                            
                                分类:
其他好文   时间:
2015-01-23 15:55:01   
                                阅读次数:
128
                             
                         
                    
                        
                            
                            
                                linux命令之玩转xargs我们可以用管道将一个命令的标准输出重定向到另一个命令的标准输出,但是有些命令只能以命令行参数的形式接收数据,而无法接受通过stdin的数据,这个时候我们就要用到xargs。xargs应该紧跟管道操作符之后。1.将多行转换为单行,将单行转换为多行。[root@localh...
                            
                            
                                分类:
系统相关   时间:
2015-01-19 14:16:20   
                                阅读次数:
284
                             
                         
                    
                        
                            
                            
                                subprocess.Popen这个模块主要就提供一个类Popen:class subprocess.Popen( args, bufsize=0, executable=None, stdin=None, stdout=None, stder...
                            
                            
                                分类:
编程语言   时间:
2015-01-15 17:43:30   
                                阅读次数:
186
                             
                         
                    
                        
                            
                            
                                Linux中,脚本语言环境中,即你用make xxx即其他一些普通linux命令,比如ls,find等,不同的数字,代表不同的含义:数字含义 标准叫法0 标准输入 stdin = standard input1 标准输出 stdout = standard output2 标准错误输出 stderr...
                            
                            
                                分类:
系统相关   时间:
2015-01-15 15:50:29   
                                阅读次数:
185