Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char gender = sc.next().charAt(0);
int age = sc.nextInt();
if (age < 18) {
if (gender == 'M')
System.out.println("BOY");
else
System.out.println("GIRL");
}
else {
if (gender == 'M')
System.out.println("MAN");
else
System.out.println("WOMAN");
}
}
}
|
cs |