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

TOP

返回列表