- import java.util.Scanner;
- public class Ch10
- {
- public static void main(String[] args)
- {
- Scanner s=new Scanner(System.in);
- int ans;
- System.out.println("<No Brainer Question>");
- System.out.println("How many legs does a pig have?\n(1)ONE (2)TWO (3)THREE (4)FOUR");
- System.out.print("Your Answer: ");
- ans=s.nextInt();
- switch(ans)
- {
- case 1:
- System.out.println("WRONG!!");
- break;
- case 2:
- System.out.println("WRONG!!");
- break;
- case 3:
- System.out.println("WRONG!!");
- break;
- case 4:
- System.out.println("Well you are SMART~~");
- break;
- default:
- System.out.println("ERROR!!!");
- }
- }
- }
複製代碼 |