//20151111
//20142973魏垚
//trycatch语句
import java.util.Scanner;
public class Try_trycatch {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("请输入学生成绩(阿拉伯数字):");
Scanner in = new Scanner(System.in);
try
{
// double a=in.nextDouble();
int a=in.nextInt();
if(a<60)
System.out.println("不及格。");
if(a>=60&&a<70)
System.out.println("及格。");
if(a>=70&&a<80)
System.out.println("中。");
if(a>=80&&a<90)
System.out.println("良。");
if(a<101&&a>=90)
System.out.println("优。");
}
catch(Exception b)
{
System.out.println("输入有误!");
}
}
}
二、运行截图