import java.util.Scanner;
public class Eext {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("请输入成绩:");
double score = scanner.nextDouble();
if (score > 8.0) {
System.out.println("请输入性别:");
char gender = scanner.next().charAt(0);
if (gender == '男') {
System.out.println("恭喜进入男子组决赛!!!");
}else if (gender == '女') {
System.out.println("恭喜进入女子组决赛!!!");
}else {
System.out.println("怪!");
}
}else {
System.out.println("淘汰");
}
}
}
标签:scanner,练习,System,else,嵌套,println,Scanner,out From: https://www.cnblogs.com/shuqiqi/p/16814989.html