本帖最後由 陳泓瑜 於 2016-10-29 11:11 編輯
- #include<iostream>
- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- re:
- system("cls");
- int a=0,b=0,c=0,d=0;
- cout<<"狗屁'賽'馬場"<<endl;
- cout<<"-------------------------------------------------------------------------|FINISH";
- cout<<"1"<<endl;
- cout<<"2"<<endl;
- cout<<"3"<<endl;
- cout<<"4"<<endl;
- system("pause");
- system("cls");
- while(a!=74 && b!=74 && c!=74 && d!=74)
- {
- int r=rand()%4; //0~3
- if(r==0)
- a++;
- else if(r==1)
- b++;
- else if(r==2)
- c++;
- else
- d++;
- cout<<"開始放屁中"<<endl;
- cout<<"-------------------------------------------------------------------------|FINISH";
- for(int i=0; i<a; i++)
- cout<<"_";
- cout<<"1"<<endl;
- for(int i=0; i<b; i++)
- cout<<"_";
- cout<<"2"<<endl;
- for(int i=0; i<c; i++)
- cout<<"_";
- cout<<"3"<<endl;
- for(int i=0; i<d; i++)
- cout<<"_";
- cout<<"4"<<endl;
- system("cls");
- }
-
- cout<<"GAME OVER!!"<<endl;
- cout<<"-------------------------------------------------------------------------|FINISH";
- for(int i=0; i<a; i++)
- cout<<"_";
- cout<<"1"<<endl;
- for(int i=0; i<b; i++)
- cout<<"_";
- cout<<"2"<<endl;
- for(int i=0; i<c; i++)
- cout<<"_";
- cout<<"3"<<endl;
- for(int i=0; i<d; i++)
- cout<<"_";
- cout<<"4"<<endl;
-
- system("pause");
- goto re;
- return 0;
- }
複製代碼 |