返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<time.h>
  4. using namespace std;
  5. int main()
  6. {   
  7.     int h1=0,h2=0,h3=0,h4=0;  
  8.     srand(time(NULL));
  9.     int random;
  10.     while(h1!=75 && h2!=75 && h3!=75 && h4!=75)
  11.     {
  12.         random=rand()%4;
  13.         if(random==0)
  14.         {
  15.             h1++;
  16.         }
  17.         else if(random==1)
  18.         {
  19.             h2++;
  20.         }
  21.         else if(random==2)
  22.         {
  23.             h3++;         
  24.         }
  25.         else if(random==3)
  26.         {
  27.             h4++;
  28.         }
  29.         cout<<"「好事成雙」賽馬場"<< endl;
  30.         cout<<"---------------------------------------------------------------------------|終點"<<endl;
  31.         for(int i=1;i<=h1;i++)
  32.         {
  33.             cout<<" ";
  34.         }
  35.         cout<<"◆"<<endl;
  36.         for(int i=1;i<=h1;i++)
  37.         {
  38.             cout<<" ";
  39.         }
  40.         cout<<"★"<<endl;
  41.         for(int i=1;i<=h1;i++)
  42.         {
  43.             cout<<" ";
  44.         }
  45.         cout<<"▲"<<endl;
  46.         for(int i=1;i<=h1;i++)
  47.         {
  48.             cout<<" ";
  49.         }
  50.         cout<<"●"<<endl;
  51.         system("cls");
  52.         
  53.     }
  54.     system("pause");
  55.     return 0;
  56. }
複製代碼

TOP

返回列表