当前位置:网站首页>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;
}边栏推荐
- J-luggage lock of ICPC Shenyang station in 2021 regional games (simple code)
- 如何查询淘宝天猫的宝贝类目
- Strategy, tactics (and OKR)
- Tonybot humanoid robot checks the port and corresponds to port 0701
- Add ZABBIX calculation type itemcalculated items
- Facebook 如何将 Instagram 从 AWS 搬到自己的服务器
- Sword finger offer 28 Symmetric binary tree
- Comprehensive evaluation of good-looking, easy-to-use and powerful handwriting note taking software: notability, goodnotes, marginnote, handwriting, notes writers, collanote, collanote, prodrafts, not
- tonybot 人形机器人 查看端口并对应端口 0701
- etcd集群权限管理和账号密码使用
猜你喜欢

Accelerating strategy learning using parallel differentiable simulation

中感微冲刺科创板:年营收2.4亿净亏1782万 拟募资6亿

NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线

US stock listing of polar: how can the delivery of 55000 units support the valuation of more than 20billion US dollars

Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值

Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in

Tonybot Humanoïde Robot Infrared Remote play 0630

Niuke: crossing the river

必贝特医药冲刺科创板:年营收97万亏损1.37亿 拟募资20亿

Sub-GHz无线解决方案Z-Wave 800 系列ZG23 soc和ZGM230S模块
随机推荐
表单文本框的使用(一) 选择文本
[qingniaochangping campus of Peking University] in the Internet industry, which positions are more popular as they get older?
PCB中常用快捷键
Paper sharing: generating playful palettes from images
Zhejiang University Edition "C language programming (4th Edition)" topic set reference ideas set
Solr series of full-text search engines - basic principles of full-text search
Raft agreement
How Facebook moves instagram from AWS to its own server
The mail function of LNMP environment cannot send mail
US stock listing of polar: how can the delivery of 55000 units support the valuation of more than 20billion US dollars
分布式事务(Seata) 四大模式详解
protobuf与grpc
ZABBIX saves the page blank after adding calculated items
J-luggage lock of ICPC Shenyang station in 2021 regional games (simple code)
Tonybot humanoid robot checks the port and corresponds to port 0701
Why is this error reported when modifying records in the database
动态获取权限
Common shortcut keys in PCB
【北大青鸟昌平校区】互联网行业中,哪些岗位越老越吃香?
超简单手机地图开发