返回列表 發帖
  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;
  7. cout<<"李奧斯本 賽馬場"<<endl;
  8. cout<<"$-----------------------------------------------------------------||終點||"<<endl;
  9. cout<<"◥1◣"<<endl;
  10. cout<<"◥2◣"<<endl;
  11. cout<<"◥3◣"<<endl;
  12. cout<<"◥4◣"<<endl<<endl;
  13. system("pause");
  14. srand(time(NULL));
  15. while((a!=68)&&(b!=68)&&(c!=68)&&(d!=68))
  16. {
  17.   r=rand()%4;
  18.   if(r==0)
  19.      a++;
  20.   if(r==1)
  21.      b++;  
  22.   if(r==2)
  23.      c++;   
  24.   if(r==3)
  25.      d++;                                       
  26. cout<<"比賽進行中...";
  27. cout<<endl<<"$-----------------------------------------------------------------||終點||"<<endl;   
  28.      for(int i=1;i<=a;i++)
  29.         cout<<" ";
  30.      cout<<"◥1◣"<<endl;
  31.      for(int i=1;i<=b;i++)
  32.         cout<<" ";
  33.      cout<<"◥2◣"<<endl;   
  34.      for(int i=1;i<=c;i++)
  35.         cout<<" ";
  36.      cout<<"◥3◣"<<endl;   
  37.      for(int i=1;i<=d;i++)
  38.         cout<<" ";
  39.      cout<<"◥4◣"<<endl;
  40.      system("cls");        
  41. }
  42.    cout<<"比賽結束";
  43.    cout<<endl<<"$-----------------------------------------------------------------||終點||"<<endl;   
  44.      for(int i=1;i<=a;i++)
  45.         cout<<" ";
  46.      cout<<"◥1◣"<<endl;
  47.      for(int i=1;i<=b;i++)
  48.         cout<<" ";
  49.      cout<<"◥2◣"<<endl;   
  50.      for(int i=1;i<=c;i++)
  51.         cout<<" ";
  52.      cout<<"◥3◣"<<endl;   
  53.      for(int i=1;i<=d;i++)
  54.         cout<<" ";
  55.      cout<<"◥4◣"<<endl;
  56. system("pause");
  57. return 0;   
  58. }
複製代碼

TOP

返回列表