import java.util.Scanner;class TestScore { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.println("请输入学生成绩:"); int score = s.nextInt(); char level; /*if(score >=90){ level = 'A'; }else if(score >=70){ level = 'B'; }else if(score >=60){ level = 'C'; }else { level = 'D'; } */ switch(score/10){ case 10: case 9: level = 'A'; break; case 8: case 7: level = 'B'; break; case 6: level ='C'; break; default: level = 'D'; } System.out.println("score:"+ score +",lever:"+level); }}