返回列表 發帖
  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=0;
  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.    
  18.     while(a!=61 && b!=61 && c!=61 && d!=61)
  19.     {
  20.         r=rand()%4;   
  21.         if(r==0)
  22.             a++;
  23.         cout<<"比賽進行中"<<endl;
  24.         cout<<"----------------------------------------------------------------|你終於到了"<<endl;
  25.         for(int i=1; i<=a; i++)
  26.             cout<<" ";  
  27.         cout<<"♀洪珝喬"<<endl;
  28.           r=rand()%4;
  29.            if(r==1)
  30.          b++;     
  31.         for(int i=1; i<=b; i++)
  32.             cout<<" ";  
  33.         cout<<"♂臧其輝"<<endl;
  34.         r=rand()%4;
  35.          if(r==2)
  36.          c++;  
  37.         for(int i=1; i<=c; i++)
  38.             cout<<" ";  
  39.         cout<<"♂小胖"<<endl;
  40.         r=rand()%4;
  41.          if(r==0)
  42.          d++;  
  43.         for(int i=1; i<=d; i++)
  44.             cout<<" ";  
  45.         cout<<"♀陳采蘊"<<endl;  
  46.         system("cls");  
  47.          
  48.         
  49.         
  50.          
  51.          
  52.     }
  53.       
  54. }
複製代碼

TOP

返回列表