成绩大于90分同学用A表示,
60到89分同学用B表示,
60分以下用C表示。

import java.util.Scanner;
public class Test1{
public static void main(String[] args){
Scanner input=new Scanner(System.in);
System.out.println(“请输入成绩”);
double score=input.nextDouble();
if(score>=90&&score<=100){
System.out.println(“A”);
}else if(score>=60&&score<=89){
System.out.println(“B”);
}else if(score>0&&score<60){
System.out.println(“C”);
}else{
System.out.println(“输入有误”);
}
}
}

用多重if对学生成绩进行分类

相关文章:

  • 2021-07-28
  • 2021-09-12
  • 2021-12-23
  • 2021-09-30
  • 2021-06-30
  • 2022-12-23
  • 2021-08-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-09-08
  • 2021-12-26
  • 2022-12-23
相关资源
相似解决方案