当前位置:网站首页>Zzuli:1045 numerical statistics
Zzuli:1045 numerical statistics
2022-07-03 14:34:00 【Snake_____】
Title Description
Statistics given n In number , negative 、 Number of zero and positive numbers .
Input
The first number entered is an integer n(n<100), Indicates the number of values to be counted , And then there was n It's an integer
Output
Output one line a,b and c, Respectively represent the negative numbers in the given data 、 Number of zero and positive numbers .
The sample input Copy
6 0 1 2 3 -1 0
Sample output Copy
1 2 3
#include <stdio.h>
int main()
{
int n,i,x=0,y=0,z=0,num;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&num);
if(num<0)
{
x+=1;
}
if(num==0)
{
y+=1;
}
if(num>0)
{
z+=1;
}
}
printf("%d %d %d",x,y,z);
return 0;
}
边栏推荐
- Tailing rushes to the scientific and Technological Innovation Board: it plans to raise 1.3 billion, and Xiaomi Changjiang is the shareholder
- x86汇编语言-从实模式到保护模式 笔记
- [qingniaochangping campus of Peking University] in the Internet industry, which positions are more popular as they get older?
- Luogu p4047 [jsoi2010] tribal division solution
- 使用并行可微模拟加速策略学习
- 中国PETG市场预测及战略研究报告(2022版)
- Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
- 超简单手机地图开发
- Bibit pharmaceutical rushed to the scientific innovation board: annual revenue of 970000, loss of 137million, proposed to raise 2billion
- Understanding of closures
猜你喜欢
牛客网:过河卒
洛谷P5018 [NOIP2018 普及组] 对称二叉树 题解
Tailing rushes to the scientific and Technological Innovation Board: it plans to raise 1.3 billion, and Xiaomi Changjiang is the shareholder
Tonybot humanoid robot starts for the first time 0630
Accelerating strategy learning using parallel differentiable simulation
Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
retrofit
Four data flows and cases of grpc
Timecho of Tianmou technology completed an angel round financing of nearly 100 million yuan to create a native timing database of the industrial Internet of things
7-15 calculation of PI
随机推荐
Niuke: crossing the river
Sword finger offer 28 Symmetric binary tree
The mail function of LNMP environment cannot send mail
tonybot 人形机器人 定距移动 代码编写玩法
Code writing and playing method of tonybot humanoid robot at fixed distance
Etcd cluster permission management and account password usage
Statistical capital consonants
puzzle(016.3)千丝万缕
JVM garbage collector
Paper sharing: generating playful palettes from images
7-20 print 99 formula table (format output)
如何查询淘宝天猫的宝贝类目
7-4 BCD decryption (10 points)
tonybot 人形机器人 查看端口并对应端口 0701
Tonybot humanoid robot infrared remote control play 0630
ConstraintLayout 的使用
FPGA blocking assignment and non blocking assignment
分布式事务(Seata) 四大模式详解
Common shortcut keys in PCB
Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them