- import java.io.Console;
- public class ch12
- {
- public static void main(String args[])
- {
- Console c=System.console();
- String str;
- int x,y;
- System.out.print("請輸入你的成績: ");
- x=Integer.parseInt(c.readLine());
- x=y/10;
- switch(y)
- {
- case 10:
- case 9:
- System.out.print("優")
- break;
- case 8:
- System.out.print("甲")
- break;
- case 7:
- System.out.print("乙")
- break;
- case 6:
- System.out.print("丙")
- break;
- case 5:
- case 4:
- case 3:
- case 2:
- case 1:
- case 0:
- System.out.print("丁")
- break;
- default:
- System.out.print
- }
- }
複製代碼 |