返回列表 發帖
  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.                 if (a>b)
  15.                 {
  16.                         cout<<"A 隊獲勝"<<endl;
  17.                 }
  18.                 else if (a<b)
  19.                 {
  20.                         cout<<"B 隊獲勝"<<endl;
  21.                 }
  22.                 else
  23.                 {
  24.                         cout<<"平手"<<endl;
  25.                 }
  26.                 system ("pause");
  27.         }
  28.         return 0;
  29. }
複製代碼

TOP

返回列表