Untitled

mail@pastecode.io avatar
unknown
java
3 years ago
768 B
25
Indexable
Never
import com.sun.security.jgss.GSSUtil;

import java.util.Locale;
import java.util.Scanner;

public class demo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double age = Double.parseDouble(scanner.nextLine()); // < 16 или >= 16
        String gender = scanner.nextLine(); // "m" или "f"

        if(gender.equals("m")){
            if (age < 16) {
                System.out.println("Master");
            } else {
                System.out.println("Mr.");
            }
        } else if (gender.equals("f")) {
            if (age < 16) {
                System.out.println("Miss");
            } else {
                System.out.println("Ms.");
            }
        }
    }
}