- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int n;
- string d[5]={"飯","麵","粥","漢堡","火鍋"};
- srand(time(NULL));
- cout<<"☆★☆抽籤程式☆★☆"<<endl;
- cout<<"今晚要吃什麼?(按Enter鍵開始抽籤)"<<endl;
- system("pause");
- system("cls");
- for(int i=0;i<=150;i++)
- {
- n=rand()%5;
- if(i%2==0)
- {
- cout<<"☆★☆抽籤中☆★☆"<<endl;
- }
- else
- {
- cout<<"★☆★抽籤中★☆★"<<endl;
- }
- cout<<d[n]<<endl;
- system("cls");
- }
- cout<<"今晚吃"<<d[n]<<"!"<<endl;
- system("pause");
- return 0;
- }
複製代碼 |