- import java.util.Scanner;
- public class Ch01 {
- public static void main(String[] args) {
- Scanner s=new Scanner(System.in);
- int answer;
- System.out.println("Q:請問臺灣首都位於?(1)台南(2)台北(3)南京(4)北京 ");
- System.out.print("A: ");
- answer=s.nextInt();
- switch(answer)
- {
- case 1:System.out.print("那是以前~");
- break;
- case 2:System.out.print("還沒確立 O3O");
- break;
- case 3:System.out.print("答對!憲法還沒修正");
- break;
- case 4:System.out.print("選這也太扯了...");
- break;
-
- }
-
- }
- }
複製代碼 |