#include <iostream>
using namespace std;
int main() {
int N = 5, cnt1 = 0, cnt2 = 0;
while(N--){
int x;
cin >> x;
cnt1 += (x % 2 == 1);
cnt2 += (x % 2 == 0);
}
cnt1 > cnt2 ? cout << "Amount of odd numbers is bigger" : cout << "Amount of even numbers is bigger";
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main() {
int N = 5, cnt1 = 0, cnt2 = 0;
while(N--){
int x;
cin >> x;
cnt1 += (x % 2 == 1);
cnt2 += (x % 2 == 0);
}
cnt1 > cnt2 ? cout << "Amount of odd numbers is bigger" : cout << "Amount of even numbers is bigger";
}