- #include <iostream>
- #include <cstdlib>
- #include <time.h>
- using namespace std;
- int main()
- {
- int h1=0,h2=0,h3=0,h4=0;
- srand(time(NULL));
- int random=0;
- cout<<"「賽馬場」"<<endl;
- cout<<"|--------------------------------------------------------------------------|終點"<<endl;
- cout<<"ω"<<endl;
- cout<<"£"<<endl;
- cout<<"Θ"<<endl;
- cout<<"卍"<<endl;
- while(h1!=75 && h2!=75 && h3!=75 && h4!=75)
- { random=rand()%4;
- if(random==0)
- { h1++;
- }
- else if(random==1)
- { h2++;
- }
- else if(random==2)
- { h3++;
- }
- else if(random==3)
- { h4++;
- }
- cout<<"比賽開始"<<endl;
- cout<<"|----------------------------------------------------------------------------|終點"<<endl;
- for(int i=1; i<=h1; i++)
- {
- cout<<" ";
- }
- cout<<"ω"<<endl;
- for(int i=1; i<=h2; i++)
- {
- cout<<" ";
- }
- cout<<"£"<<endl;
- for(int i=1; i<=h3; i++)
- {
- cout<<" ";
- }
- cout<<"Θ"<<endl;
- for(int i=1; i<=h4; i++)
- {
- cout<<" ";
- }
- cout<<"卍"<<endl;
- system("cls");
-
- }
- system("pause");
- return 0;
- }
複製代碼 |