本帖最後由 許洧熏 於 2021-1-30 19:48 編輯
- #include<iostream>
- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- string f[]={"雞","豬","牛","羊","藥","鍋"};
- srand(time(NULL));
- re:
- system("cls");
- cout<<"*** 抽籤 ***"<<endl;
- cout<<"今天晚餐\吃什麼?"<<endl<<endl;
- system("pause");
- for(int y=1; y<=52; y++)
- {
- if(y%2==1)
- cout<<"★☆★ 抽籤ing ★☆★"<<endl;
- else
- cout<<"☆★☆ 抽籤ing ☆★☆"<<endl;
- cout<<f[rand()%6]<<"!"<<endl;
- if(y<=30)
- _sleep(20);
- else
- _sleep(20+(y-30)*(y-30));
- system("cls");
- }
- cout<<"吃: "<<f[rand()%6]<<"!"<<endl<<endl;
- system("pause");
- goto re;
- return 0;
- }
複製代碼 |