Submission
Status:
PPPPP
Subtask/Task Score:
100/100
Score: 100
User: Chawin
Problemset: คำนำหน้าชื่อ
Language: c
Time: 0.001 second
Submitted On: 2025-10-10 11:28:16
#include <stdio.h>
int main(){
char name[20];
int gender, age, marry;
gets(name);
scanf("%d %d %d", &gender, &age, &marry);
char title[4][7] = {"Miss", "Master", "Mr.", "Mrs."};
if(gender){ //ชาย
if(age < 15){
printf("%s %s", title[1], name);
}
else{
printf("%s %s", title[2], name);
}
}
else{
if(age < 15){
printf("%s %s", title[0], name);
}
else{
if(marry){
printf("%s %s", title[3], name);
}
else{
printf("%s %s", title[0], name);
}
}
}
return 0;
}