当前位置:网站首页>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;
}边栏推荐
猜你喜欢

Sword finger offer 28 Symmetric binary tree

puzzle(016.3)千丝万缕

How to query the baby category of tmall on Taobao

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

Use of constraintlayout

Protobuf and grpc

Pyqt interface production (login + jump page)

一文了解微分段应用场景与实现机制
![洛谷P4047 [JSOI2010]部落划分 题解](/img/7f/3fab3e94abef3da1f5652db35361df.png)
洛谷P4047 [JSOI2010]部落划分 题解

Comprehensive evaluation of good-looking, easy-to-use and powerful handwriting note taking software: notability, goodnotes, marginnote, handwriting, notes writers, collanote, collanote, prodrafts, not
随机推荐
Convert string to decimal integer
Zabbix添加Calculated items后保存页面成空白
如何查询淘宝天猫的宝贝类目
MongoDB索引
7-15 calculation of PI
Selective sorting
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
Mongodb index
Luogu p3065 [usaco12dec]first! G problem solution
Happy capital new dual currency fund nearly 4billion yuan completed its first account closing
String reverse order
天谋科技 Timecho 完成近亿元人民币天使轮融资,打造工业物联网原生时序数据库
Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值
DDK for XP
Zhonggan micro sprint technology innovation board: annual revenue of 240million, net loss of 17.82 million, proposed to raise 600million
Some concepts about agile
Protobuf and grpc
Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them
x86汇编语言-从实模式到保护模式 笔记
Thread.sleep和TimeUnit.SECONDS.sleep的区别