Submission

Status:

-----

Subtask/Task Score:

0/100

Score: 0

User: Kei

Problemset: คำนำหน้าชื่อ

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-08 15:05:47

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;

void solve(){
    string first, last; cin >> first >> last;    // the name line has two words
    int g, age, m; cin >> g >> age >> m;
    if(g==0){
        if(age<15){
            cout << "Master " << first << ' ' << last;
            return;
        }
        cout << "Mr. " << first << ' ' << last;
        return;
    }
    else{
        if(age<15 || m == 0){
            cout << "Miss " << first << ' ' << last;
            return;
        }
        cout << "Mrs. " << first << ' ' << last;
        return;
    }
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}