- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- string food[]={"牛排","垃圾","大便","老師和蟑螂夾心","龍蝦大漢堡","該減肥了,通通不要吃!!"};
- re:
- system("cls");
- cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
- cout<<"今天晚餐\吃什麼?"<<endl<<endl;
- system("pause");
- for(int i=1;i<=30;i++)
- {
- if(i<20)
- {
- if(i%2==0)
- cout<<"★☆★ 抽籤中 ★☆★"<<endl;
- else
- cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
- cout<<food[rand()%6]<<"!"<<endl;
- _sleep(100);
- system("cls");
- }
- else
- {
- if(i%2==0)
- cout<<"★☆★ 抽籤中 ★☆★"<<endl;
- else
- cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
- cout<<food[rand()%6]<<"!"<<endl;
- _sleep(200);
- system("cls");
- }
-
- }
- cout<<"吃: "<<food[rand()%6]<<"!"<<endl;
- system("pause");
- goto re;
- return 0;
- }
複製代碼 |