import java.util.Scanner;
public class GradeIf
{
public static void main(String args[])
{
double Score=0.0;
System.out.println("请输入成绩");
Scanner sc=new Scanner(System.in);
while (sc.hasNextDouble())
{
Score=sc.nextDouble();
if(Score<60)
System.out.println("D级");
else
if(Score<70)
System.out.println("C级");
else
if(Score<85)
System.out.println("B级");
else
System.out.println("A级");
}
sc.close();
}
}
运行结果: