지나가던 개발자
[C] 백준 2083번(럭비 클럽) 문제 풀이 본문
#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)을 통해 무한 반복을 할 수 있다!
'PS > C' 카테고리의 다른 글
[C] 백준 13909번(창문 닫기) 문제 풀이 (0) | 2022.11.22 |
---|---|
[C] 백준 25904번(안녕 클레오파트라 세상에서 제일가는 포테이토칩) 문제 풀이 (0) | 2022.10.31 |
[C] 백준 5554번(심부름 가는 길) 문제 풀이 (0) | 2022.10.19 |
Comments