【java】给出一百分制成绩,要求输出成绩等级’A’,’B’,’C’,’D’,’E’。90 分以上为’A’,80~89 分为’B’,70~79 分为’C’,60~69 分为’D’,60分以下为’E’

package test;
import java.util.Scanner;
public class test2 {
	public static void main(String[] args) {
		Scanner input =new Scanner(System.in);
		System.out.println("进入成绩查询系统");
		System.out.println("输入成绩:\n");
		int i=input.nextInt();
		if(i>=90){
			  System.out.println("成绩等级为A");
			 }
		else if((i>=80)&&(i<90)) {
			System.out.println("成绩等级为B");
		}
		else if((i>=70)&&(i<80)) {
			System.out.println("成绩等级为C");
		}
		else if((i>=60)&&(i<70)) {
			System.out.println("成绩等级为E");
		}
		else{
			System.out.println("成绩等级为F");
		}
		
		 }
}

猜你喜欢

转载自blog.csdn.net/qq_43416226/article/details/89296176