๋ชฉ๋ก์œผ๋กœ
๋ฐฑ์ค€

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;
}

๋Œ“๊ธ€