Submission
Status:
PPPPP
Subtask/Task Score:
100/100
Score: 100
User: Bestzu
Problemset: คำนำหน้าชื่อ
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-14 22:59:29
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
string fname, lname; cin >> fname >> lname;
bool man;
cin >> man;
int age; cin >> age;
bool married;
cin >> married;
if(man) {
if(age < 15) {
cout << "Master ";
}
else {
cout << "Mr. ";
}
}
else {
if(age < 15 || !married) {
cout << "Miss ";
}
else {
cout << "Mrs. ";
}
}
cout << fname << " " << lname;
return 0;
}