- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- string n[]={"漢堡","三明治","炒飯","吐司夾蛋","披薩"};
- srand(time(NULL));
- cout<<"☆★☆抽籤程式☆★☆"<<endl;
- cout<<"今天中午要吃什麼?"<<endl;
- system("pause");
- system("cls");
- for(int i=1;i<=50;i++)
- {
- if(i%2==1)
- cout<<"☆★☆抽籤中☆★☆"<<endl;
- else
- cout<<"☆★☆抽籤中☆★☆"<<endl;
- cout<<"吃"<<n[rand()%5]<<endl;
- if(i<30)
- _sleep(20);
- else
- _sleep(20+(i-30)*(i-30));
- system("cls");
- }
- cout<<"吃:"<<n[rand()%5]<<endl;
- system("pause");
- return 0;
- }
複製代碼 |