본문 바로가기

Programming/BaekJoon

[C++] 백준 10886번 : 0 = not cute / 1 = cute


https://www.acmicpc.net/problem/10886




#include <iostream>

using namespace std;

int main() {


int n;

cin >> n;


int k,cnt=0;

for (int i = 0; i < n; i++) {

cin >> k;

k == 1 ? cnt++ : 0;

}

if (cnt > n / 2)

cout << "Junhee is cute!\n";

else

cout << "Junhee is not cute!\n";


}