循环条件
- 如果输入0-100 则正常判断
- 如果输入T 则退出当前循环
public class FGrade {
public static void main(String[]args){
Scanner s = new Scanner(System.in);
String m="-1";
while(!"t".equalsIgnoreCase(m)){
System.out.println("请输入学生成绩:");
m = s.next();
if("t".equalsIgnoreCase(m)){
System.out.println("感谢使用");
break;
}else{
int n = Integer.parseInt(m);
String str = (n>=90)?"A":(n>=60)?"B":"C";
System.out.println(str);
}
}
}
}