17588

#include <stdio.h>

int main(void){
    int count, max = 0;
    int result[200] = {0};

    // 정수 n 입력
    scanf("%d", &count);

    for(int i = 0; i < count; i++){
        int number;
        // 암송한 숫자 입력
        scanf("%d", &number);

        // 해당 인덱스에 숫자 있음을 표시
        result[number] = 1;

        // 최대값 저장
        if(max < number){
            max = number;
        }
    }

    // 출력
    int good = 1;
    for(int j = 1; j <= max; j++){
        if(result[j] == 0){     // 없는 숫자가 있을 경우 
            printf("%d\n", j);  // 없는 숫자 출력
            good = 0;           // 없는 숫자 있음을 표시
        }
    }

    // 다 맞으면 good job~
    if(good){
        printf("good job");
    }
    return 0;
}

'백준' 카테고리의 다른 글

[ 백준 / C ] 31746번 : SciComLove (2024)  (0) 2025.09.08
[ 백준 / C ] 15633번 : Fan Death  (0) 2025.09.08
[ 백준 / C ] 9494번 : Text Roll  (0) 2025.09.04
[ 백준 / C ] 5565번 : 영수증  (0) 2025.09.03
[ 백준 / C ] 8393번 : 합  (0) 2025.09.02

+ Recent posts