Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: Sunsblad

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

Language: cpp

Time: 0.003 second

Submitted On: 2026-04-11 18:21:22

#include <iostream>
#include <string>
using namespace std;
int main()
{
	string k,m;
	int age;
	bool a, c;
	cin >> k >> m >> a >> age >> c;
	if (a) {
		if (age < 15) {
			cout << "Master ";
		}
		else {
			cout << "Mr. ";
		}
	}
	else {
		if (age < 15) {
			cout << "Miss ";
		}
		else {
			if (c == 0) {
				cout << "Miss ";
			}
			else {
				cout << "Mrs. ";
			}
		}
	}
	cout << k <<' '<< m;
}