当前位置:网站首页>C language: 11. Pipeline
C language: 11. Pipeline
2022-07-27 19:34:00 【Brother rabbit head】
c Language :11、 The Conduit
1、linux Pipeline introduction
see /etc/ Does the following include ab Character file ls /etc/ | grep ab
The essence of the above order is to ls The output stream of the command is as grep Input stream of command
2、c Examples of language use pipelines
/avg.c
avg.c It mainly calculates the average value of two numbers
#include <stdio.h>
int main()
{
int sum,num;
scanf("%d,%d", &sum,&num);
float result = sum/num;
printf("result=%f\n", result);
return 0;
}

/input.c
input.c It mainly counts the sum and quantity of all the input figures
#include <stdio.h>
int main()
{
int flag=1;
int i;
int count=0;
int s=0;
while(flag){
scanf("%d", &i);
if(0==i) break;
count++;
s+=i;
}
printf("%d,%d\n", s, count);
return 0;
}

avg.c and input.c Use pipes in series , Calculation 3000+2000 Average value 
边栏推荐
- Power control
- Latex use - control the display position of tables or graphics
- Summary of "performance test" of special test
- 27. Basics of golang - mutex lock, read / write lock
- Summary of APP launch in vivo application market
- Analysis of Eureka server
- 换行问题双保险
- Take byte offer in four rounds and answer the interview questions
- 正十七边形尺规作图可解性复数证明
- What if idea successfully connects to the database without displaying the table
猜你喜欢

Basic network faults and troubleshooting

内存管理A4

阿里云对象存储OSS的开通和使用

5W奖金池/面向高校,2022法律科技创新大赛报名火热进行中

浅谈基本的网络基本故障和问题排查

ES6 learning notes (1) - quick start

c语言:5、多维数组

2022 preparation for autumn recruitment 10W word interview sketch PDF version, with operating system and computer network interview questions

成本高、落地难、见效慢,开源安全怎么办?

Kettle consolidated record data reduction
随机推荐
一篇让你掌握线程和线程池,还解决了线程安全问题,确定不看看?
What if idea successfully connects to the database without displaying the table
时间复杂度和空间复杂度
C language printing diamond
Basic concepts of Nacos and single machine deployment
SQL Server top keyword usage
Summary of APP launch in vivo application market
Matrix of shell programming -- it's cute and cool
There is a problem with the time zone when the idea connects to the database. The server returns invalid timezone is red Need to set ‘serverTimezone‘ property.
idea优化小攻略
Kettle switch / case control to realize classification processing
Mongodb learning notes (1) - install mongodb and its related configurations
C language: C language code style
Using functions to extract numbers from text strings in Excel
Word 2007+ tips
阿里云视频点播服务的开通和使用
Can set be used to define local variables in OPDS SQL
sql 时间处理(SQL SERVER\ORACLE)
kettle 合并记录 数据减少
kettle 分列、合并记录