Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: theem1502

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

Language: c

Time: 0.002 second

Submitted On: 2025-09-21 19:45:33

#include <stdio.h>

int main() {
    char name[101];
    fgets(name, 101, stdin);
    

    int gender, age , status;
    scanf("%d %d %d",&gender, &age, &status);

    if (gender == 1 && age < 15) {
        printf("%s%s", "Master ", name);
        return 0;
    }
    if (gender == 1 && age >= 15) {
        printf("%s%s", "Mr. ", name);
        return 0;
    }
    if (gender == 0 && age < 15 || status == 0) {
        printf("%s%s", "Miss ", name);
        return 0;
    }
    if (gender == 0 && age >= 15 && status == 1) {
        printf("%s%s", "Mrs. ", name);
        return 0;
    }
}