Untitled
unknown
plain_text
3 years ago
451 B
4
Indexable
#include <iostream>
using namespace std;
int main()
{
int a,c1=0,d0=0,e=0;
cin >> a;
int b[a];
for(int i=0; i<a; i++){
cin >> b[i];
if(b[i]==1){
c1++;
}
if(b[i]==0){
d0++;
}
}
if(c1>d0){
cout << d0;
return 0;
}
if(d0>c1){
cout << c1;
return 0;
}
if(d0==c1){
cout << c1;
return 0;
}
}Editor is loading...