返回列表 發帖
本帖最後由 曹祁望 於 2022-11-18 20:04 編輯
  1. #include<iostream>
  2. #include<cstdlib>

  3. using namespace std;
  4. int main()
  5. {
  6.     int ans;
  7.     string sch;
  8.     int h;
  9.     int w;
  10.     string name;
  11.    
  12.     cout<<"為了證明你是真人,請回答這個問題"<<endl;
  13.     cout<<"8的3次根號="<<endl;
  14.     cin>>ans;
  15.     if(ans==2)
  16.     {
  17.         cout<<"你是人"<<endl;
  18.         
  19.         cout<<"學校:"<<endl;
  20.         cin>>sch;
  21.         cout<<"名字:"<<endl;
  22.         cin>>name;
  23.         cout<<"身高(cm):"<<endl;
  24.         cin>>h;
  25.         cout<<"體重(kg):"<<endl<<endl;
  26.         cin>>w;
  27.         cout<<"你的名字:"<<name<<endl;
  28.         cout<<"你的學校:"<<sch<<endl;
  29.         cout<<"你的身高(cm):"<<endl;
  30.         cout<<"你的體重(kg):"<<endl<<endl;
  31.         
  32.         if(h<130)
  33.         {
  34.             cout<<"你是矮子"<<endl;
  35.         }
  36.         if(w>90)
  37.         {
  38.             cout<<"你很胖"<<endl;
  39.         }
  40.     }
  41.     else
  42.     {
  43.         cout<<"數學不行阿"<<endl;
  44.     }
  45.    
  46.     system("pause");
  47.     return 0;
  48. }
複製代碼

TOP

返回列表