알고리즘

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

J3SUNG 2019. 9. 13. 13:20
728x90

0과 1을 입력받아서
0이 크면 Junhee is not cute!를
1이 크면 Junhee is cute!를 출력합니다.

 

#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
using namespace std;

int main(int argc, char* argv[])
{
	int n;
	int num;
	int cute = 0;
	int notCute = 0;

	cin >> n;

	while (n--) {
		cin >> num;

		if (num == 1) {
			++cute;
		}
		else {
			++notCute;
		}
	}

	if (cute < notCute) {
		cout << "Junhee is not cute!" << endl;
	}
	else {
		cout << "Junhee is cute!" << endl;
	}

	return 0;
}