본문 바로가기

PS_Baekjoon

[백준 C++] 2083번 : 럭비 클럽

https://www.acmicpc.net/problem/2083

 

2083번: 럭비 클럽

입력 받은 각 회원에 대해 이름과 분류를 출력한다. 성인부 회원이면 'Senior', 청소년부 회원이면 'Junior'를 출력한다.

www.acmicpc.net

코드 :

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    string name;
    int age, weight;

    while(cin >> name >> age >> weight && name != "#"){
        if(age > 17 || weight >= 80){
            cout << name << ' ' << "Senior\n";
        }else{
            cout << name << ' ' << "Junior\n";
        }
    }
}

'PS_Baekjoon' 카테고리의 다른 글

[백준 C++] 5717번 : 상근이의 친구들  (0) 2023.04.26
[백준 C++] 4470번 : 줄번호  (0) 2023.04.25
[백준 C++] 1264번 : 모음의 개수  (0) 2023.04.23
[백준 C++] 5339번 : 콜센터  (0) 2023.04.22
[백준 C++] 4101번 : 크냐?  (0) 2023.04.21