- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- string m[]={"炒飯",
- "烏龍麵",
- "牛排",
- "火鍋",
- "燒烤"},
- n[]={"☆★☆ 抽籤中 ☆★☆",
- "★☆★ 抽籤中 ★☆★"};
- cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
- cout<<"今天晚餐\吃什麼?"<<endl<<endl;
- system("pause");
- for(int i=1;i<=20;i++)
- {
- system("cls");
- cout<<n[i%2]<<endl;
- cout<<m[rand()%5]<<"!"<<endl;
- _sleep(50);
- }
- system("cls");
- cout<<"吃: "<<m[rand()%5]<<"!"<<endl;
- system("pause");
- return 0;
- }
複製代碼 |