Advertisement
uuuyyttu

hello.java USE FOR NEXT TIME

Mar 5th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.06 KB | None | 0 0
  1. import java.io.*;
  2. public class hello {
  3.   public static void main(String[] args) throws IOException {
  4.     BufferedReader inputW=new BufferedReader(new InputStreamReader(System.in));
  5.     System.out.println("安安你好,你正常嗎?1:正常,2:不正常");
  6.     boolean health=false;
  7.     int health_t,height,weight,age;
  8.     health_t=Integer.parseInt(inputW.readLine());
  9.     if(health_t==1||health_t==2){
  10.         if(health_t==1)
  11.             health=true;
  12.         else
  13.             health=false;
  14.     }
  15.     else
  16.         System.out.println("請勿亂按鍵盤");
  17.    
  18.     System.out.println("請輸入身高");
  19.     height=Integer.parseInt(inputW.readLine());
  20.     System.out.println("請輸入體重");
  21.     weight=Integer.parseInt(inputW.readLine());
  22.     System.out.println("請輸入年齡");
  23.     age=Integer.parseInt(inputW.readLine());
  24.     System.out.println("PROCESSING..............");
  25.     if(!health)
  26.         System.out.println("等你舒服點再玩");
  27.     else if(height<130||weight<35)
  28.         System.out.println("等你大隻點再來玩");
  29.     else if(age<7)
  30.         System.out.println("爸爸媽媽呢?");
  31.     else
  32.         System.out.println("歡迎~");
  33.    
  34.   }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement