# 判断及格(Pass judgment)-其他

## 判断及格(Pass judgment)

``````package testing;
import java.util.Scanner;

public class panduan {
public static void main(String[] args) {
String str="";
Scanner sc = new Scanner(System.in);
System.out.println("请输入分数：");
str = sc.next();
double score;
try {
score = Integer.parseInt(str);
if(score>=0&&score<60)
System.out.println("不及格");
else if(score>=60&&score<70)
System.out.println("及格");
else if(score>=70&&score<80)
System.out.println("中");
else if(score>=80&&score<90)
System.out.println("良");
else if(score>=90&&score<100)
System.out.println("优秀");
else
System.out.println("分数输入不正确");
}catch(Exception e) {
System.out.println("分数输入不正确");
}
}
}``````
————————

Write a program that requires the user to input an integer to represent the examination results of a course. The program then gives the conclusions of “failed”, “passed”, “medium”, “good” and “excellent”.

``````package testing;
import java.util.Scanner;

public class panduan {
public static void main(String[] args) {
String str="";
Scanner sc = new Scanner(System.in);
System.out.println("请输入分数：");
str = sc.next();
double score;
try {
score = Integer.parseInt(str);
if(score>=0&&score<60)
System.out.println("不及格");
else if(score>=60&&score<70)
System.out.println("及格");
else if(score>=70&&score<80)
System.out.println("中");
else if(score>=80&&score<90)
System.out.println("良");
else if(score>=90&&score<100)
System.out.println("优秀");
else
System.out.println("分数输入不正确");
}catch(Exception e) {
System.out.println("分数输入不正确");
}
}
}``````