返回列表 發帖
本帖最後由 蔡庭豪 於 2015-10-17 11:08 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.         int x;
  7.         cout<<"輸入您成績:"<<endl;
  8.         cin>>x;
  9.         if(x>=80&&x<=100)
  10.         {
  11.             cout<<"好成績,甲等"<<endl;
  12.     }
  13.         else if(x>=60&&x<=79)
  14.     {
  15.             cout<<"普通成績,乙等"<<endl;
  16.     }
  17.     else if(x>=0&&x<=59)
  18.     {
  19.             cout<<"不及格成績,丙等,吃屎吧"<<endl;
  20.     }
  21.     else if(x>100&&x<0)
  22.     {
  23.             cout<<"你撒謊"<<endl;
  24.     }
  25.     system("pause");
  26.     return 0;   
  27. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdilb>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x,y;
  7.     cout<<"請輸入你的身高(cm):"<<x<<endl;
  8.     cin>>x;
  9.     cout<<"請輸入你的體重(kg):"<<y<<endl;
  10.     cin>>y;
  11.     cout<<"您的bmi值:"<<x/[(y/100)*2]<<
  12. }   
複製代碼

TOP

返回列表