当前位置:网站首页>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;
}
边栏推荐
- Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
- BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
- Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
- Electronic Association C language level 1 34, piecewise function
- The number of patent applications in China has again surpassed that of the United States and Japan, ranking first in the world for 11 consecutive years
- [thread pool]
- Book list | as the technical support Party of the Winter Olympics, Alibaba cloud's technology is written in these books!
- NLP-文献阅读总结
- Rhcsa the next day
- University stage summary
猜你喜欢
CMS source code of multi wechat management system developed based on thinkphp6, with one click curd and other functions
在所有SwiftUI版本(1.0-4.0)中原生实现Charts图表视图之思路
[network security] what is emergency response? What indicators should you pay attention to in emergency response?
In the era of low code development, is it still needed?
Tri des fonctions de traitement de texte dans MySQL, recherche rapide préférée
Technical experts from large factories: common thinking models in architecture design
NLP literature reading summary
【森城市】GIS数据漫谈(一)
How to share the source code anti disclosure scheme
Introduction to rce in attack and defense world
随机推荐
Why does the producer / consumer mode wait () use while instead of if (clear and understandable)
【FreeRTOS】FreeRTOS学习笔记(7)— 手写FreeRTOS双向链表/源码分析
The most effective futures trend strategy: futures reverse merchandising
Chain ide -- the infrastructure of the metauniverse
Enter the year, month, and determine the number of days
Zabbix agent主动模式的实现
Go learning notes - constants
[Valentine's day] - you can change your love and write down your lover's name
[Mori city] random talk on GIS data (I)
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
Routing decorator of tornado project
Redis - detailed explanation of cache avalanche, cache penetration and cache breakdown
[freertos] freertos Learning notes (7) - written freertos bidirectionnel Link LIST / source analysis
2022-021rts: from the second half of the year
[thread pool]
How to input single quotation marks and double quotation marks in latex?
手写简易版flexible.js以及源码分析
Data double write consistency between redis and MySQL
两年前美国芯片扭捏着不卖芯片,如今芯片堆积如山祈求中国帮忙
Blue Bridge Cup Quick sort (code completion)