- import java.util.Scanner;
- public class Ch05 {
- public static void main(String args[]){
- Scanner s=new Scanner(System.in);
- int A;
- System.out.println("<小米腦殘問答>");
- System.out.println("請問狗有幾隻腳?(1);1隻(2)2隻(3)3隻(4)4隻");
- System.out.println("請回答:");
- A=s.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("輸入錯誤!!");
-
-
- }
- }
- }
複製代碼 |