本帖最後由 呂尚霖 於 2021-1-30 19:47 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- string food[]={"可樂","牛排","甜甜圈","意麵","豬大便","核彈"};
- srand(time(NULL));
- re:
- system("cls");
- cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
- cout<<"今天晚餐吃什麼?"<<endl<<endl;
- system("pause");
- cout<<"★☆★ 抽籤中 ★☆★"<<endl;
- for(int i=1; i<=30; i++)
- {
- if(i%2==1)
- cout<<"★☆★ 抽籤中 ★☆★"<<endl;
- else
- cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
- cout<<food[rand()%6]<<"!"<<endl;
- _sleep(50);
- system("cls");
- }
- for(int i=1; i<=23; i++)
- {
- if(i%2==1)
- cout<<"★☆★ 抽籤中 ★☆★"<<endl;
- else
- cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
- cout<<food[rand()%6]<<"!"<<endl;
- _sleep(111);
- system("cls");
- }
- for(int i=1; i<=15; i++)
- {
- if(i%2==1)
- cout<<"★☆★ 抽籤中 ★☆★"<<endl;
- else
- cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
- cout<<food[rand()%6]<<"!"<<endl;
- _sleep(144);
- system("cls");
- }
- cout<<"吃: "<<food[rand()%6]<<"!"<<endl<<endl;
- system("pause");
- goto re;
- return 0;
- }
複製代碼 |