Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: PEPSEALSEA

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-13 11:43:48

#include "bits/stdc++.h"

using namespace std;

int main(){
    string name;
    int sex = 0;
    int age = 0;
    int married = 0;

    getline(cin , name);
    cin >> sex >> age >> married;

    if (sex == 0){
        if(age >= 15){
            if(married == 0){
                cout << "Miss " << name;
            }
            else if(married == 1){
                cout << "Mrs. " << name;
            }
        }
        else{
            cout << "Miss " << name;
        }
    }
    else if(sex == 1){
        if(age >= 15){
            cout << "Mr. " << name;
        }
        else{
            cout << "Master " << name;
        }
    }

    return 0;
}