当前位置:网站首页>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;
}边栏推荐
- 中国PETG市场预测及战略研究报告(2022版)
- Statistical capital consonants
- Recent learning summary
- Strategy, tactics (and OKR)
- puzzle(016.4)多米诺效应
- Jiuyi cloud black free encryption free version source code
- 洛谷P4047 [JSOI2010]部落划分 题解
- 添加Zabbix计算类型项目Calculated items
- Solr series of full-text search engines - basic principles of full-text search
- 亚马逊、速卖通、Lazada、Shopee、eBay、wish、沃尔玛、阿里国际、美客多等跨境电商平台,测评自养号该如何利用产品上新期抓住流量?
猜你喜欢

Niuke: crossing the river

分布式事务(Seata) 四大模式详解

tonybot 人形机器人 查看端口并对应端口 0701

表单文本框的使用(一) 选择文本

Sub-GHz无线解决方案Z-Wave 800 系列ZG23 soc和ZGM230S模块

Tonybot humanoid robot infrared remote control play 0630

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

Understanding of closures

Showmebug entered Tencent conference, opening the era of professional technical interview

Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in
随机推荐
dllexport和dllimport
How Facebook moves instagram from AWS to its own server
Get permissions dynamically
String sort
Stop asking yourself if you are suitable for software testing
pyQt界面制作(登录+跳转页面)
Some concepts about agile
Statistical capital consonants
Thread. Sleep and timeunit SECONDS. The difference between sleep
Programming language: the essence of type system
【北大青鸟昌平校区】互联网行业中,哪些岗位越老越吃香?
MongoDB索引
Understanding of closures
7-14 sum integer segments (C language)
Thread.sleep和TimeUnit.SECONDS.sleep的区别
Puzzle (016.3) is inextricably linked
Comprehensive evaluation of good-looking, easy-to-use and powerful handwriting note taking software: notability, goodnotes, marginnote, handwriting, notes writers, collanote, collanote, prodrafts, not
Niuke: crossing the river
Use of constraintlayout
Bibit pharmaceutical rushed to the scientific innovation board: annual revenue of 970000, loss of 137million, proposed to raise 2billion