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