- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re1:
- int a=0, b=0, c=0, d=0, r=0;
- system("cls");
- cout<<"賽跑場"<<endl;
- cout<<"----------------------------------------------------------------|你終於到了"<<endl;
- cout<<"♀洪珝喬"<<endl;
- cout<<"♂臧其輝"<<endl;
- cout<<"♂小胖"<<endl;
- cout<<"♀陳采蘊"<<endl;
- system("pause");
- system("cls");
-
- while(a!=61 && b!=61 && c!=61 && d!=61)
- {
- r=rand()%4;
- if(r==0)
- a++;
- cout<<"比賽進行中"<<endl;
- cout<<"----------------------------------------------------------------|你終於到了"<<endl;
- for(int i=1; i<=a; i++)
- cout<<" ";
- cout<<"♀洪珝喬"<<endl;
- r=rand()%4;
- if(r==1)
- b++;
- for(int i=1; i<=b; i++)
- cout<<" ";
- cout<<"♂臧其輝"<<endl;
- r=rand()%4;
- if(r==2)
- c++;
- for(int i=1; i<=c; i++)
- cout<<" ";
- cout<<"♂小胖"<<endl;
- r=rand()%4;
- if(r==0)
- d++;
- for(int i=1; i<=d; i++)
- cout<<" ";
- cout<<"♀陳采蘊"<<endl;
- system("cls");
-
-
-
-
-
- }
-
- }
複製代碼 |