#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int gay1=0, gay2=0, gay3=0, gay4=0, rad=0;
system("cls");
cout<<"尬賽馬場"<<endl;
cout<<"------------------------------------------------------------------------| 終點"<<endl;
cout<<"◆"<<endl;
cout<<"★"<<endl;
cout<<"▲"<<endl;
cout<<"●"<<endl;
system("pause");
system("cls");
while(gay1!=75, gay2!=75, gay3!=75, gay4!=75)
{
rad=rand()%4; //產生0~3之隨機亂數
if(rad==0)
gay1++;
else if(rad==1)
gay2++;
else if(rad==2)
gay3++;
else if(rad==3)
gay4++;
cout<<"比賽進行中"<<endl;
cout<<"------------------------------------------------------------------------| 終點"<<endl;
for(int i=1; i<=gay1; i++)
cout<<" ";
cout<<"◆"<<endl;
for(int i=1; i<=gay2; i++)
cout<<" ";
cout<<"★"<<endl;
for(int i=1; i<=gay3; i++)
cout<<" ";
cout<<"▲"<<endl;
for(int i=1; i<=gay4; i++)
cout<<" ";
cout<<"●"<<endl;
system("cls");
}
system("pause");
return 0;
} |