回復 1# tonyh - import java.io.Console;
- public class ch09
- {
- public static void main(String args[])
- {
- Console keyin=System.console();
- int int1;
- Float ft2;
- System.out.print("請你的成績:");
- int1=Integer.parseInt(keyin.readLine());
- int1=int1/10;
- switch(int1)
- {
- case 10:
- System.out.print("恭喜您當老師了!");
- break;
- case 9: case 8: case 7: case 6:
- System.out.print("恭喜您及格了!");
- break;
- case 5: case 4: case 3: case 2: case 1:
- System.out.print("恭喜您重修了!");
- break;
- case 0:
- System.out.print("恭喜您可以回家了!");
- break;
- default:
- System.out.print("恭喜您亂打了!");
- }
- }
- }
複製代碼 |