Submission
Status:
PPPPP
Subtask/Task Score:
100/100
Score: 100
User: chs_14
Problemset: คำนำหน้าชื่อ
Language: cpp
Time: 0.002 second
Submitted On: 2026-01-20 15:37:56
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio();
int gender, age, married;
string firstname, lastname, title;
cin >> firstname >> lastname >> gender >> age >> married;
if (!gender) {
if (age>15 && married) {
title = "Mrs.";
}
else {
title = "Miss";
}
}
else {
if (age<15) {
title = "Master";
}
else {
title = "Mr.";
}
}
cout << title << ' ' << firstname << ' ' << lastname;
return 0;
}