当前位置:网站首页>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;
}
边栏推荐
- [Mori city] random talk on GIS data (I)
- Paddleocr prompt error: can not import AVX core while this file exists: xxx\paddle\fluid\core_ avx
- Chapter 1 programming problems
- Solution of running crash caused by node error
- Zephyr learning notes 1, threads
- MySQL中的文本處理函數整理,收藏速查
- How to send mail with Jianmu Ci
- Valentine's Day is coming! Without 50W bride price, my girlfriend was forcibly dragged away...
- Handwritten easy version flexible JS and source code analysis
- Review of enterprise security incidents: how can enterprises do a good job in preventing source code leakage?
猜你喜欢

Chain ide -- the infrastructure of the metauniverse

Text processing function sorting in mysql, quick search of collection

Four sets of APIs for queues

Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology

用于压缩视频感知增强的多目标网络自适应时空融合

Flink memory model, network buffer, memory tuning, troubleshooting

The most effective futures trend strategy: futures reverse merchandising

Unity opens the explorer from the inspector interface, selects and records the file path

What is industrial computer encryption and how to do it

Crawler (III) crawling house prices in Tianjin
随机推荐
Electronic Association C language level 1 34, piecewise function
2022-021ARTS:下半年開始
Vulhub vulnerability recurrence 77_ zabbix
人生规划(Flag)
Rhcsa day 3
大厂技术专家:架构设计中常用的思维模型
[kubernetes series] kubesphere is installed on kubernetes
Directory of tornado
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
Zephyr 學習筆記2,Scheduling
"Sword finger offer" 2nd Edition - force button brush question
tornado项目之路由装饰器
[Mori city] random talk on GIS data (I)
Crawler (III) crawling house prices in Tianjin
How to share the source code anti disclosure scheme
Valentine's Day is coming! Without 50W bride price, my girlfriend was forcibly dragged away...
Routing decorator of tornado project
How notepad++ counts words
Comparison between applet framework and platform compilation
Used on windows Bat file startup project