Untitled

 avatar
unknown
plain_text
3 years ago
380 B
2
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...