返回列表 發帖
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

TOP

本帖最後由 許洧熏 於 2021-1-30 19:48 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. using namespace std;
  5. int main()
  6. {
  7.    string f[]={"雞","豬","牛","羊","藥","鍋"};
  8.    srand(time(NULL));
  9.    re:
  10.    system("cls");
  11.    cout<<"*** 抽籤 ***"<<endl;
  12.    cout<<"今天晚餐\吃什麼?"<<endl<<endl;
  13.    system("pause");
  14.    for(int y=1; y<=52; y++)
  15.    {
  16.         if(y%2==1)
  17.             cout<<"★☆★ 抽籤ing ★☆★"<<endl;
  18.         else
  19.             cout<<"☆★☆ 抽籤ing ☆★☆"<<endl;
  20.         cout<<f[rand()%6]<<"!"<<endl;
  21.         if(y<=30)
  22.             _sleep(20);
  23.         else
  24.             _sleep(20+(y-30)*(y-30));
  25.         system("cls");   
  26.    }
  27.    cout<<"吃: "<<f[rand()%6]<<"!"<<endl<<endl;
  28.    system("pause");
  29.    goto re;   
  30.    return 0;
  31. }
複製代碼

TOP

返回列表