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