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