- package junior;
- import java.util.Scanner;
- public class junior {
- public static void main(String args[]){
- while(true){
- Scanner c =new Scanner(System.in);
- System.out.println("<小米腦殘問題>");
- System.out.println("請問豬有幾隻腳?(1)1隻 (2)2隻 (3)3隻(4)4隻 ");
- System.out.println("請回答: ");
- int a =c.nextInt();
- switch(a)
- {
- case 1 :
- System.out.println("用跳的嗎?");
- break;
- case 2:
- System.out.println("沒吃過豬肉也看過豬走路!");
- break;
- case 3 :
- System.out.println("你是豬啊?");
- break;
- case 4:
- System.out.println("答對了!");
- break;
- default:
- System.out.println("輸入錯誤!");
- }
- }
- }
- }
複製代碼 |