返回列表 發帖
  1. import java.util.Scanner;


  2. public class Ch01 {

  3.         public static void main(String[] args) {
  4.                    Scanner s=new Scanner(System.in);
  5.                    int answer;
  6.                    System.out.println("您剛抽中了IPHONE X!");
  7.                    System.out.println("只要回答下列問題,就能馬上額外加碼switch!");
  8.                    System.out.println("有一艘船快沉船了,船上有436位乘客,468桶燃料,請問:韓國瑜繼續當高雄市長的機率是多少?(1)100趴(2)韓總不會耽誤市政啦(3)放眼世界,征服宇宙(4)紫色,因為外星人不會戴帽子");
  9.                    answer=s.nextInt();
  10.                    switch(answer)
  11.                    {
  12.                  
  13.                
  14.                          case 1:
  15.                                    System.out.println("趴你阿公啦");
  16.                                break;
  17.                          case 2:
  18.                                    System.out.println("最好是,我聽你喇賽");
  19.                                    break;
  20.                              case 3:
  21.                                    System.out.println("供三小??");
  22.                                    break;
  23.                              case 4:
  24.                                        System.out.println("哦哦哦哦哦哦哦哦 對了餒!");
  25.                                        break;
  26.                          default:
  27.                                    System.out.println("你再繼續亂打沒關係");
  28.                   
  29.                    }

  30.         }

  31. }
複製代碼

TOP

返回列表