返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. using namespace std;
  5. int main(){
  6.     string food[]={"漢堡","牛排","羊肉爐","意麵","大便","餿水"};
  7.     srand(time(NULL));
  8. re:
  9.     system("cls");
  10.     cout<<"☆★☆抽籤程式☆★☆"<<endl;
  11.     cout<<"今天晚上要吃什麼?"<<endl;
  12.     system("pause");
  13.     for(int i=1;i<=30;i++)
  14.     {

  15.         if(i%2==1)
  16.         cout<<"☆★☆抽籤中☆★☆"<<endl;
  17.         else
  18.         cout<<"★☆★抽籤中★☆★"<<endl;
  19.     cout<<food[rand()%6]<<"!"<<endl;
  20.     _sleep(50);
  21.     system("cls");
  22.     }
  23.     cout<<"吃"<<food[rand()%6]<<endl;
  24.     system("pause");
  25.     goto re;
  26.     return 0;
  27. }
複製代碼

TOP

返回列表