- #include<iostream>
- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- string f[]={"雞","豬","牛","羊","藥","鍋"};
- srand(time(NULL));
- re:
- system("cls");
- cout<<"*** 抽籤 ***"<<endl;
- cout<<"今天晚餐\吃什麼?"<<endl<<endl;
- system("pause");
- for(int y=1; y<=30; y++)
- {
- if(y%2==1)
- cout<<" ★☆★抽籤ing ★☆★"<<endl;
- else
- cout<<" ☆★☆抽籤ing ☆★☆"<<endl;
- cout<<f[rand()%6]<<"!"<<endl;
- _sleep(50);
- system("cls");
- }
- cout<<"吃: "<<f[rand()%6]<<"!"<<endl<<endl;
- system("pause");
- goto re;
- return 0;
- }
複製代碼 |