当前位置:网站首页>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;
}
边栏推荐
- Convert string to decimal integer
- Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
- 556. 下一个更大元素 III : 简单构造模拟题
- Mysql多表查询 #子查询
- Bibit pharmaceutical rushed to the scientific innovation board: annual revenue of 970000, loss of 137million, proposed to raise 2billion
- 修改数据库中的记录为什么报这个错
- Happy capital new dual currency fund nearly 4billion yuan completed its first account closing
- The mail function of LNMP environment cannot send mail
- Luogu p5018 [noip2018 popularization group] symmetric binary tree problem solution
- Programming language: the essence of type system
猜你喜欢
亚马逊、速卖通、Lazada、Shopee、eBay、wish、沃尔玛、阿里国际、美客多等跨境电商平台,测评自养号该如何利用产品上新期抓住流量?
npm install卡住与node-npy的各种奇怪报错
Sword finger offer 28 Symmetric binary tree
分布式事务(Seata) 四大模式详解
Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in
表单文本框的使用(一) 选择文本
puzzle(016.3)千丝万缕
Paper sharing: generating playful palettes from images
ShowMeBug入驻腾讯会议,开启专业级技术面试时代
Use of constraintlayout
随机推荐
表单文本框的使用(一) 选择文本
556. 下一个更大元素 III : 简单构造模拟题
Convert string to decimal integer
洛谷P5194 [USACO05DEC]Scales S 题解
Tonybot humanoid robot infrared remote control play 0630
Table of mathematical constants by q779
7-17 crawling worms (break exercise)
Thread.sleep和TimeUnit.SECONDS.sleep的区别
puzzle(016.4)多米诺效应
泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
7-23 currency conversion (using array conversion)
Raft agreement
Selective sorting
关于敏捷的一些概念
7-22 tortoise and rabbit race (result oriented)
adc128s022 ADC verilog设计实现
dllexport和dllimport
Special research report on the market of lithium battery electrolyte industry in China (2022 Edition)
fpga阻塞赋值和非阻塞赋值
如何查询淘宝天猫的宝贝类目