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

TOP

返回列表