- #include<iostream>
- #include<cstdlib>
- #include<time.h>
- using namespace std;
- int main()
- {
- int a1=0,a2=0,a3=0,a4=0,random=0;
- srand(time(NULL));
- cout<<"「好事成雙」賽馬場"<<endl;
- cout<<"-------------------------------------------------------------[終點"<<endl;
- cout<<"●"<<endl;
- cout<<"▼"<<endl;
- cout<<"■"<<endl;
- cout<<"★"<<endl;
- while(a1!=75&&a2!=75&&a3!=75&&a4!=75)
- {
- random=rand()%4;
- if(random==0) {
- a1++;
- }
- else if(random==1)
- {
- a2++;
- }
- else if(random==2)
- {
- a3++;
- }
- else if(random==3)
- {
- a4++;
- }
- cout<<"「好事成雙」賽馬場"<<endl;
- cout<<"-------------------------------------------------------------[終點"<<endl;
- for(int i=1; i<=a1; i++)
- {
- cout<<" ";
- }
- cout<<"◆"<<endl;
-
- for(int i=1; i<=a2; i++)
- {
- cout<<" ";
- }
- cout<<"★"<<endl;
-
- for(int i=1; i<=a3; i++) {
- cout<<" ";
- }
- cout<<"▲"<<endl;
-
- for(int i=1; i<=a4; i++) {
- cout<<" ";
- }
- cout<<"●"<<endl;
- system("cls");
- }
- system("pause");
- return 0;
-
- }
複製代碼 |