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