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;
}
'알고리즘' 카테고리의 다른 글
[C++] 백준 10798번 세로읽기 (0) | 2019.09.13 |
---|---|
[C++] 백준 2960번 에라토스테네스의 체 (0) | 2019.09.13 |
[C++] 백준 5565번 영수증 (0) | 2019.09.13 |
[C++] 백준 5543번 상근날드 (0) | 2019.09.13 |
[C++] 백준 10797번 10부제 (0) | 2019.09.13 |