返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int score;
  7.     cout<<"請輸入你的分數:";
  8.     cin>>score;
  9.     if(score>=60)
  10.     {
  11.        cout<<"恭喜你!及格了!"<<endl;
  12.     }else
  13.     {
  14.        cout<<"不及格!斬!"<<endl;
  15.     }
  16.     system("pause");
  17.     return 0;
  18. }
複製代碼

TOP

  1.     int a;
  2.     int b;
  3.    
  4.     cout<<"請輸入a:";
  5.     cin>>a;
  6.     cout<<"請輸入b:";
  7.     cin>>b;
  8.    
  9.     cout<<"a="<<a<<endl;
  10.     cout<<"b="<<b<<endl;
  11.    
  12.     if(a<b)
  13.     {
  14.            cout<<"a大於"<<endl;
  15.     }
  16.     else
  17.     {
  18.            cout<<"a小於b<<endl;
  19.     }
  20.      else  if(a<b)
  21.     {
  22.            cout<<"a等於b"<<endl;
  23.     }
  24.    
  25.     system("pause")
  26.     return 0;
  27. }
複製代碼

TOP

返回列表