import java.io.*; import java.lang.*; public class MyScore { public static void main(String args[])throws IOException { double score=59; String str,s="成绩为:"; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.print("输入成绩:");//输出提示信息 str=br.readLine();//BufferedReader类的readLine方法接收键盘输入的字符串 score=Double.parseDouble(str); if(score>=90) System.out.println(s+"优秀!"); else if(score>=80&&score<90) System.out.println(s+"良好!"); else if(score>=70&&score<80) System.out.println(s+"中!"); else if(score>=60&&score<70) System.out.println(s+"及格!"); else System.out.println(s+"不及格!"); } }