Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: FIrmTInn

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-12 14:47:21

#include<iostream>
using namespace std;
int main(){
    int gender,age,marry;
    string name;
    getline(cin,name);
    cin >> gender >> age >> marry;
    if(gender == 1){
        if(age <= 15){
            cout << "Master ";
        }
        else{
            cout << "Mr. ";
        }
    }
    else{
        if(age <= 15){
            cout << "Miss ";
        }
        else{
            if(marry == 1){
                cout << "Mrs. ";
            }
            else{
                cout << "Miss ";
            }
        }
    }
    cout << name;

    return 0;
}