- #include<iostream>
- #include<ctime>
- using namespace std;
- int main()
- {
- int r=1;
- int op;
- int pur;
- int bal=0;
- re:
- int s[]={0,0,0,0};
- string h[]={"◆","★","▲","●"};
- srand(time(NULL));
- cout<<endl<<endl;
- cout<<"Round "<<r<<endl;
- cout<<"★★★The Wetherby Racecourse★★★"<<endl;
- cout<<"-------------------------------------------------------------------------|Finish"<<endl;
- for(int i=0;i<=3;i++)
- cout<<h[i]<<endl;
- cout<<endl<<"Balance: $"<<bal<<endl<<endl;
- cout<<"(1)Deposit (2) Place Bid (3)Return to main menu"<<endl;
- cout<<"Enter option: ";
- cin>>op;
- if(op==1){
-
- cout<<"Deposit Amount: ";
- cin>>pur;
- bal=bal+pur;
- goto re;
- }
- system("pause");
- while(true)
- {
- system("cls");
- int o=rand()%4;
- s[o]++;
- cout<<"Round "<<r<<endl;
- cout<<"★★★The Wetherby Racecourse★★★"<<endl;
- cout<<"-------------------------------------------------------------------------|Finish"<<endl;
- for(int i=0; i<4; i++)
- {
- for(int j=0; j<s[i]; j++)
- {
- cout<<" ";
- }
- cout<<h[i]<<endl;
- }
-
- if (s[o]==73)
- break;
- _sleep(50);
- }
- system("cls");
- cout<<"Race Finished"<<endl;
- cout<<"Round "<<r<<endl;
- cout<<"★★★The Wetherby Racecourse★★★"<<endl;
- cout<<"-------------------------------------------------------------------------|Finish"<<endl;
- for(int i=0; i<4; i++)
- {
- for(int j=0; j<s[i]; j++)
- {
- cout<<" ";
- }
- cout<<h[i]<<endl;
- }
-
- for(int i=0;i<=3;i++)
- {
- if(s[i]==73)
- {
- cout<<h[i]<<" Won The Race"<<endl;
- }
- }
- r++;
- goto re;
-
- system("pause");
- return 0;
- }
複製代碼 |