日期:2014-05-20 浏览次数:20819 次
package test2;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class A {
private static void inner() throws Exception {
short num;
InputStreamReader a = new InputStreamReader(System.in);
BufferedReader b = new BufferedReader(a);
System.out.println("请输入成绩: " + "分");
String c = b.readLine();
if (c.equals("exit"))
System.exit(0);
else{
num = Short.parseShort(c);
if (num >= 90)
System.out.println("优秀");
if (num >= 80)
System.out.println("一般");
if (num >= 70)
System.out.println("良好");
if (num >= 60)
System.out.println("合格");
else
System.out.println("不合格");
}
inner();
}
public static void main(String[] args) throws Exception {
inner();
}
}
InputStreamReader a=new InputStreamReader (System.in);
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class A {
private static void inner() throws Exception {
short num;
InputStreamReader a = new InputStreamReader(System.in);
BufferedReader b = new BufferedReader(a);
System.out.println("请输入成绩: " + "分");
String c = b.readLine();
// exit 跳出循环否则,不断读取输入;跳出执行system.exit(0),结束。
while(!c.equals("exit")) {
num = Short.parseShort(c);
if (num >= 90)
System.out.println("优秀");
else if (num >= 80)
System.out.println("一般");
else if (num >= 70)