지나가던 개발자

[C] 백준 2083번(럭비 클럽) 문제 풀이 본문

PS/C

[C] 백준 2083번(럭비 클럽) 문제 풀이

KwonYongHyeon 2022. 10. 29. 17:39

 

#include <stdio.h>

int main() {
    while (1) {
        char name[10];
        int age, weight;
        scanf("%s %d %d", &name, &age, &weight);
        if ((age == 0) && (weight == 0)) {
            break;
        }
        if ((age > 17) || (weight >= 80)) {
            printf("%s Senior \n", name);
            continue;
        }
        printf("%s Junior \n", name);
    }

    return 0;
}

 

while (1)을 통해 무한 반복을 할 수 있다!

Comments