?? comparescore.java
字號:
package 第三章;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class CompareScore {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
CompareScore cs = new CompareScore();
try {
String gradetmp = cs.getInput("請輸入考試成績:");
int grade = Integer.parseInt(gradetmp);
if (grade >= 95) {
System.out.println("your achievement is excellent");
} else if (grade >= 85)
System.out.println("your achievement is good");
else if (grade >= 75)
System.out.println("your achievement is middling");
else if (grade >= 60)
System.out.println("your achievement is passed");
else
System.out.println("your achievement is bad");
} catch (Exception e) {
e.printStackTrace();
}
}
// 得到系統輸入
protected String getInput(String question) throws IOException {
// Input stream reader object.
BufferedReader stdIn = new BufferedReader(new InputStreamReader(
System.in));
System.out.print(question);
return stdIn.readLine();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -