返回列表 發帖
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int n=0;
  4. int main()
  5. {
  6. re:
  7.     n++;
  8.     system("cls");
  9.     int s[]= {0,0,0,0};
  10.     string p[]= {"◆","★","▲","●"};
  11.     int r;
  12.     srand(time(NULL));
  13.     cout<<"「好事成雙」賽馬場"<<"第"<<n<<"局"<<endl;
  14.     cout<<"-------------------------------------------------------------------------| 終點"<<endl;
  15.     for(int i=0; i<4; i++)
  16.     {
  17.         cout<<p[i]<<endl;
  18.     }
  19.     system("pause");
  20.     system("cls");
  21.     while(s[r]<=71)
  22.     {
  23.         r=rand()%4;
  24.         s[r]++;
  25.         cout<<"比賽進行中"<<endl;
  26.         cout<<"-------------------------------------------------------------------------| 終點"<<endl;
  27.         for(int i=0; i<4; i++)
  28.         {
  29.             for(int j=0; j<s[i]; j++)
  30.             {
  31.                 cout<<" ";
  32.             }
  33.             cout<<p[i]<<endl;
  34.         }
  35.         _sleep(25);
  36.         system("cls");
  37.     }
  38.     cout<<"比賽結束,由"<<p[r]<<"先馳得點"<<endl;
  39.     cout<<"-------------------------------------------------------------------------| 終點"<<endl;
  40.     for(int i=0; i<4; i++)
  41.     {
  42.         for(int j=0; j<s[i]; j++)
  43.             cout<<" ";
  44.         cout<<p[i]<<endl;
  45.     }
  46.     system("pause");
  47.     system("cls");
  48.     goto re;
  49.     return 0;
  50. }
複製代碼

TOP

返回列表