- #include<iostream>
- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- string f[]={"空氣","大便","杯子","盤子","湯匙"};
- cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl<<endl;
- cout<<"今天晚餐\吃什麼?"<<endl<<endl;
- system("pause");
- for(int i=0; i<=30; i++)
- {
- if(i%2==1)
- cout<<"★☆★ 抽籤中 ★☆★"<<endl;
- else
- cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
- cout<<f[rand%6]<<"!"<<endl;
- _sleep(50);
- system("cls");
- }
- cout<<"吃"<<f[rand%6]<<"!"<<endl<<endl;
- system("pause");
- return 0;
- }
複製代碼 |