package lianxi; import java.util.*; public class Xvexichengji { public static void main(String[] args) { System.out.println("輸入姓名"); Scanner xingming = new Scanner(System.in); String ren = xingming.next(); System.out.println("輸入成績"); while (true) { Scanner chengji = new Scanner(System.in); Double shu = chengji.nextDouble(); if (shu > 100 || shu < 0) { System.out.println("輸入的成績有誤,請重新輸入"); continue; } else { if (shu >= 90) { System.out.println(ren+"的成績為A"); break; } else if (shu < 60) { System.out.println(ren+"的成績為C"); break; } else { System.out.println(ren+"的成績為B"); break; } } } } }
