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