返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.      int a=0,b=0,c=0,d=0,r=0;
  7.      rel:
  8.      cout<<"好事成雙賽馬場"<<endl;
  9.      cout<<"------------------------------------------------------------------------| 終點"<<endl;        
  10.      cout<<"★"<<endl;
  11.      cout<<"■"<<endl;
  12.      cout<<"●"<<endl;
  13.      cout<<"◆"<<endl;
  14.      system("pause");
  15.      system("cls");
  16.      while(a!=75 && b!=75 && c!=75 && d!=75)
  17.      {
  18.         r=rand()%4;
  19.         if(r==0)
  20.         {
  21.            a=a+1;        
  22.         }
  23.         if(r==1)
  24.         {
  25.            b=b+1;        
  26.         }
  27.         if(r==2)
  28.         {
  29.            c=c+1;        
  30.         }
  31.         if(r==3)
  32.         {
  33.            d=d+1;        
  34.         }
  35.         cout<<"比賽進行中"<<endl;
  36.         cout<<"------------------------------------------------------------------------| 終點"<<endl;
  37.         for(int i=0;i<=a;i++)
  38.         {
  39.            cout<<" ";               
  40.         }
  41.         cout<<"★"<<endl;      
  42.         for(int i=0;i<=b;i++)
  43.         {
  44.            cout<<" ";               
  45.         }
  46.         cout<<"■"<<endl;
  47.         for(int i=0;i<=c;i++)
  48.         {
  49.            cout<<" ";               
  50.         }
  51.         cout<<"●"<<endl;
  52.         for(int i=0;i<=d;i++)
  53.         {
  54.            cout<<" ";               
  55.         }
  56.         cout<<"◆"<<endl;
  57.         system("cls");         
  58.      }
  59.      system("cls");
  60.      goto rel;
  61.      system("pause");
  62.      return 0;   
  63. }
複製代碼

TOP

返回列表