Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: Prap

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

Language: cpp

Time: 0.003 second

Submitted On: 2026-03-25 12:42:22

#include <iostream>
#include <cmath>
#include <vector>
#include <string>
using namespace std;
int main() {
	string nig,ger;
	int gender,age,marry;
	cin>>nig>>ger>>gender>>age>>marry;
	if (gender == 1) {
		if (age<15) {
			cout<<"Master "<<nig<<" "<<ger;
		}
		else {
			cout<<"Mr. "<<nig<<" "<<ger;
		}
	}
	else {
		if (age<15) {
			cout<<"Miss "<<nig<<" "<<ger;
		}
		else if (marry == 0 && age > 15) {
			cout<<"Miss "<<nig<<" "<<ger;
		}
		else {
			cout<<"Mrs. "<<nig<<" "<<ger;
		}
	}
	return 0;
}