- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- string food[]={"漢堡","牛排","屎","羊肉爐","意麵","餿水","蟑螂","人"};
- srand(time(NULL));
- re:
- system("cls");
- cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
- cout<<"今天晚餐\吃什麼?"<<endl<<endl;
- system("pause");
- for(int i=1; i<=55; i++)
- {
- if(i%2==1)
- cout<<"★☆★ 抽籤中 ★☆★"<<endl;
- else
- cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
- cout<<food[rand()%8]<<"!"<<endl;
- if(i<=30)
- _sleep(20);
- else
- _sleep(20+(i-30)*(i-30));
- system("cls");
- }
- cout<<"吃: "<<food[rand()%8]<<"!"<<endl<<endl;
- system("pause");
- goto re;
- return 0;
- }
複製代碼 |