题解 | #判断学生成绩等级#
判断学生成绩等级
https://www.nowcoder.com/practice/caef110bb06149119672a4dd2bc5d4ad
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String grade =sc.next(); if(grade.equals("A")){ System.out.println("优秀"); }else if(grade.equals("B")){ System.out.println("良好"); }else if(grade.equals("C")){ System.out.println("及格"); }else if(grade.equals("D")){ System.out.println("不及格"); }else { System.out.println("未知等级"); } } }
java相关 文章被收录于专栏
java刷题,或许会有其他方面