Untitled
Anonymous
plain_text
11/10/2022 6:02 PM
508 B
20
Indexable
#include <iostream>
using namespace std;
int main() {
int n, x, c1, c2, BEBRA;
cin >> n;
BEBRA = 1;
c1 = 0;
c2 = 0;
for (int i = 1; i <= n; i++) {
cin >> x;
if (x == 1) {
c1 += 1;
}
if (x == 0) {
c2 += 1;
}
else (BEBRA + 1);
}
if (c1 > c2) {
cout << c2;
}
if (c1 < c2) {
cout << c1;
}
if (c1 == c2) {
cout << c1;
}
}Editor is loading...