5 minutes LATEX uses entry writing LLNCS paper lonely Hongzi

2022-12-23  

Question Address: https://www.patest.cn/contests/gPlt/L1-022

Question:

Given N positive integer, please count the odds and even numbers?

Input format:

Input the first line to give a positive N (<= 1000); the second line gives N positive integer, separated by spaces.

output format:

In the line, the number of strange numbers, the number of even numbers. The middle is separated by 1 space.

Input sample:

9
88 74 101 26 15 0 34 22 77

output sample:

3 6

code:

#include<iostream>
using namespace std;
int main()
{
    int n,i;
    cin>>n;
    int number;
    int ji=0,ou=0;
    for(i=0;i<n;i++)
    {
        cin>>number;
        if(number%2==0)ou=ou+1;
        else ji=ji+1;
    }
    cout<<ji<<" "<<ou<<endl;
    return 0;
}

source

Related Posts

Sword refers to OFFER-flip word sequence sequence Hanani

wgs84 Earth coordinate system, GCJ02 Mars coordinate system, BD09 Baidu coordinate system profile and conversion

How to completely uninstall Anaconda? LORD

JS DateTime type to the front end iOS is not compatible

5 minutes LATEX uses entry writing LLNCS paper lonely Hongzi

Random Posts

STM32F030CT86 timer 3 channel 1 to verify the PWM front and rear cut mode

MAC system Install XGBOOST

IOS integrates Charts drawing a chart framework in OC project

spring cloud netflix service found: Eureka (1) register and run WYX

Struts 1.2.4 Learning experience! (Seven)