Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: Catpao

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-09-30 17:37:43

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string a,b;
	int gender,age,marry;
	cin>>a>>b;
	cin>>gender;
	cin>>age;
	cin>>marry;
	if(gender == 1){
		if(age < 15){
			cout<<"Master"<<' '<<a<<' '<<b;
		}
		else{
			cout<<"Mr."<<' '<<a<<' '<<b;
		}
	}
	else if(gender == 0){
		if(age < 15){
			cout<<"Miss"<<' '<<a<<' '<<b;
		}
		else{
			if(marry == 0){
				cout<<"Miss"<<' '<<a<<' '<<b;
			}
			else if(marry == 1){
				cout<<"Mrs."<<' '<<a<<' '<<b;
			}
		}
	}
}