給定一個百分制的分數,輸出相應的等級。 90分以上 A級 80~89 B級 70~79 C級
阿新 • • 發佈:2018-12-30
90分以上 A級
80~89 B級
70~79 C級
60~69 D級
60分以下 E級
public class And{
publiv static void main(String[] args){
Scanner scanner=new Scanner(System.in);
int aa=scanner.nextInt();
System.out.println("請輸入你的分數");
if(aa>90){
System.out.println("A級");
}
if(aa>80&&aa<89){
System.out.println("B級")
}
if(aa>70&&aa<79){
System.out.println("C級")
}
if(aa>60&&aa<69){
System.out.println("D級")
}
if(aa<60){
System.out.println("E級")
}
}
}