//小明考试成绩奖罚 import java.util.Scanner; public class Test{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); System.out.println(“小明同学请输入你的成绩:”); int score=sc.nextInt(); //if…else if…else结构 if(score>100||score<0){ System.out.println(“你输入的数据有误,请重新输入”); }else if(score>=95&&score<=100){ System.out.println(“恭喜小明获得布加迪一辆”); }else if(score>=80&&score<=94){ System.out.println(“恭喜小明获得捷安特自行车一辆”); }else if(score>=70&&score<=79){ System.out.println(“恭喜小明获得游乐园一日游”); }else{ System.out.println(“小明请面对疾风吧”); } } }