返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     srand(time(NULL));
  7.     string m[]={"炒飯",
  8.               "烏龍麵",
  9.               "牛排",
  10.               "火鍋",
  11.               "燒烤"},
  12.            n[]={"☆★☆ 抽籤中 ☆★☆",
  13.                 "★☆★ 抽籤中 ★☆★"};   
  14.     cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
  15.     cout<<"今天晚餐\吃什麼?"<<endl<<endl;
  16.     system("pause");
  17.     for(int i=1;i<=20;i++)
  18.     {
  19.         system("cls");
  20.         cout<<n[i%2]<<endl;
  21.         cout<<m[rand()%5]<<"!"<<endl;
  22.         _sleep(50);
  23.     }
  24.     system("cls");
  25.     cout<<"吃: "<<m[rand()%5]<<"!"<<endl;
  26.     system("pause");
  27.     return 0;
  28. }
複製代碼

TOP

返回列表