当前位置:网站首页>L1-022 odd even split (10 points)
L1-022 odd even split (10 points)
2022-07-04 07:29:00 【Inter personal liabilities^】
L1-022 Parity separation (10 branch )
Given N A positive integer , Please count the number of odd and even Numbers ?
Input format :
The first line of input gives us a positive integer N(≤1000); The first 2 Line is given N Nonnegative integers , Space off .
Output format :
Output the number of odd Numbers successively in a line 、 Number of even Numbers . In the middle to 1 Space separation .
sample input :
9
88 74 101 26 15 0 34 22 77
sample output :
3 6
AC Code
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<sstream>
using namespace std;
typedef long long ll;
const int N=100010;
int main()
{
int n;
int a = 0, b = 0;
cin >> n;
while(n -- )
{
int x;
cin >> x;
if(x % 2 == 0) b ++ ;
else a ++ ;
}
cout << a << ' ' << b << endl;
return 0;
}
边栏推荐
- Vulhub vulnerability recurrence 76_ XXL-JOB
- 2022 - 021arts: début du deuxième semestre
- Electronic Association C language level 1 35, bank interest
- MySQL 数据库 - 函数 约束 多表查询 事务
- 电子协会 C语言 1级 34 、分段函数
- flask-sqlalchemy 循环引用
- Routing decorator of tornado project
- Four sets of APIs for queues
- How notepad++ counts words
- The important role of host reinforcement concept in medical industry
猜你喜欢

Crawler (III) crawling house prices in Tianjin

Vulhub vulnerability recurrence 76_ XXL-JOB

Oceanbase is the leader in the magic quadrant of China's database in 2021

Go learning notes - constants

System architecture design of circle of friends

《剑指Offer》第2版——力扣刷题

Introduction to rce in attack and defense world

Amd RX 7000 Series graphics card product line exposure: two generations of core and process mix and match

【Kubernetes系列】Kubernetes 上安装 KubeSphere

节点基础~节点操作
随机推荐
Knowledge payment applet dream vending machine V2
The cloud native programming challenge ended, and Alibaba cloud launched the first white paper on application liveliness technology in the field of cloud native
How to input single quotation marks and double quotation marks in latex?
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
Introduction to deep learning Ann neural network parameter optimization problem (SGD, momentum, adagrad, rmsprop, Adam)
Tri des fonctions de traitement de texte dans MySQL, recherche rapide préférée
Computer connects raspberry pie remotely through putty
MySQL 数据库 - 函数 约束 多表查询 事务
【Kubernetes系列】Kubernetes 上安装 KubeSphere
What is the use of cloud redis? How to use cloud redis?
How to buy financial products in 2022?
Guoguo took you to write a linked list, and the primary school students said it was good after reading it
Go learning notes - constants
Types of references in BibTex
【FreeRTOS】FreeRTOS学习笔记(7)— 手写FreeRTOS双向链表/源码分析
flask-sqlalchemy 循环引用
Node foundation ~ node operation
[Flink] temporal semantics and watermark
Valentine's Day is coming! Without 50W bride price, my girlfriend was forcibly dragged away...
Set JTAG fuc invalid to normal IO port