当前位置:网站首页>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;
}边栏推荐
- 泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
- SSH访问控制,多次失败登录即封掉IP,防止暴力破解
- JVM garbage collector
- pyQt界面制作(登录+跳转页面)
- Stop asking yourself if you are suitable for software testing
- 添加Zabbix计算类型项目Calculated items
- Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
- 556. 下一个更大元素 III
- tonybot 人形机器人 定距移动 代码编写玩法
- The mail function of LNMP environment cannot send mail
猜你喜欢

Code writing and playing method of tonybot humanoid robot at fixed distance

Use of constraintlayout

Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs

Sword finger offer 28 Symmetric binary tree

Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them

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

tonybot 人形机器人 红外遥控玩法 0630

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

Understanding of closures

泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
随机推荐
天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪
Stop asking yourself if you are suitable for software testing
使用并行可微模拟加速策略学习
ConstraintLayout 的使用
DDK for XP
Table of mathematical constants by q779
Doris学习笔记之数据表的创建
表单文本框的使用(一) 选择文本
Find books ()
Although not necessarily the best, it must be the hardest!
retrofit
Some concepts about agile
7-17 crawling worms (break exercise)
Too many files with unapproved license
Ultra simple mobile map development
fpga阻塞赋值和非阻塞赋值
X86 assembly language - Notes from real mode to protected mode
关于敏捷的一些概念
SSH访问控制,多次失败登录即封掉IP,防止暴力破解
愉悦资本新双币基金近40亿元完成首次关账