返回列表 發帖
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;

  4. int main ()
  5. {
  6.         while(true)
  7.         {
  8. int a;
  9. int b;
  10. cout<<"請輸入 A 隊分數:";
  11. cin>> a;
  12. cout<<"請輸入 B 隊分數:";
  13. cin>> b;
  14.        
  15.         if(a > b)
  16.         {
  17.                 cout<<"A 隊獲勝"<<endl;
  18.        
  19.         }       
  20.                
  21.         else if (b > a)       
  22.                 {
  23.                         cout<<"B 隊獲勝"<<endl;
  24.                 }
  25.                 else
  26.                 {
  27.                         cout <<"平手"<<endl;
  28.                 }
  29.                
  30.                 system ("pause");
  31.         }
  32.         return 0;
  33. }
複製代碼

TOP

返回列表