1 import java.util.Scanner; 2 public class TestSum { 3 /** 4 * @param args 5 */ 6 public static void main(String[] args) { 7 // TODO Auto-generated method stub 8 System.out.println("请输入分数"); 9 Scanner Sc=new Scanner(System.in); 10 int Score=Sc.nextInt(); 11 12 if(Score>=90){ 13 System.out.println("优"); 14 }else if(Score>=70&&Score<90){ 15 System.out.println("良"); 16 }else if(Score>=60&&Score<70){ 17 System.out.println("中"); 18 }else{ 19 System.out.println("差"); 20 } 21 } 22 }
原文:http://www.cnblogs.com/launolife/p/7223214.html