BOJ - [Basic Algebra - 10039 0 = not cute / 1 = cute] - BronzeIII๐ฅ
https://www.acmicpc.net/problem/10886 ์ด ๋ฌธ์ ๋ ํฌ๊ฒ ์ค๋ช ํ ๋ถ๋ถ์ ์์ด๋ณด์ธ๋ค. ๊ทธ๋ฅ ํฌํ๊ฐ 1,0์ ๊ฐฏ์๋ง ๋ถ๋ฆฌํ๊ณ ๋๊ฐ์ ๊ฐ๋ง ๋น๊ตํ๋๊ฒ ๋.
1๋ถ ์ฝ๊ธฐ
๋ฌธ์
https://www.acmicpc.net/problem/10886
์ค๋ช
์ด ๋ฌธ์ ๋ ํฌ๊ฒ ์ค๋ช ํ ๋ถ๋ถ์ ์์ด๋ณด์ธ๋ค. ๊ทธ๋ฅ ํฌํ๊ฐ 1,0์ ๊ฐฏ์๋ง ๋ถ๋ฆฌํ๊ณ ๋๊ฐ์ ๊ฐ๋ง ๋น๊ตํ๋๊ฒ ๋.
์ฝ๋
#include <stdio.h>
int main() {
int n,cute=0,n_cute=0;
scanf("%d",&n);
for (int i=0; i<n;i++)
{
int temp;
scanf("%d",&temp);
if (temp == 1)
cute++;
else if (temp == 0)
n_cute++;
}
if (cute > n_cute)
printf("Junhee is cute!\n");
else
printf("Junhee is not cute!\n");
return 0;
}