- #include<iostream>
- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- cout<<"日本東京競馬場<東京優駿>[2400m草地]"<<endl;
- cout<< "----------------------------------------------------------------------|goal"<<endl;
- cout<<"◆"<<endl;
- cout<<"★"<<endl;
- cout<<"▲"<<endl;
- cout<<"●"<<endl;
- system("pause");
- system("cls");
- srand(time(NULL));
- int a=0,b=0,c=0,d=0,r;
- while(a<=70 && b<=70 && c<=70 && d<=70)
- {
- cout<<"賽馬進行中"<<endl;
- cout<<"------------------------------------------------------------------------| 終點"<<endl;
- r = rand()%4+1;
- switch(r)
- {
- case 1:
- a++;
- break;
- case 2:
- b++;
- break;
- case 3:
- c++;
- break;
- case 4:
- d++;
- break;
- }
- for(int i=0;i<=a;i++)
- {
- cout<<" ";
- }
- cout<<"◆"<<endl;
- for(int i=0;i<=b;i++)
- {
- cout<<" ";
- }
- cout<<"★"<<endl;
- for(int i=0;i<=c;i++)
- {
- cout<<" ";
- }
- cout<<"▲"<<endl;
- for(int i=0;i<=d;i++)
- {
- cout<<" ";
- }
- cout<<"●"<<endl;
- system("cls");
- }
-
- system("pause");
- return 0;
- }
複製代碼 |