返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     srand(time(NULL));
  7.     string food[8]={"蔥油餅","牛排","義大利麵","炒飯","便當","日本壽司","頓飯","油飯"};
  8.     cout<<"◇◆◇抽籤程式◇◆◇"<<endl;
  9.     cout<<"今天晚餐\吃:"<<food[rand()%5];
  10.     system("pause");
  11.     for(int i=1; i<=30; i++)
  12.     {
  13.         if(i%2==1)
  14.             cout<<"◇◆◇抽籤中◇◆◇"<<endl;
  15.         else
  16.             cout<<"◆◇◆抽籤中◆◇◆"<<endl;
  17.         cout<<food[rand()%5]<<"!"<<endl;
  18.         _sleep;
  19.         system("cls");
  20.     }
  21.     system("pause");
  22.     return 0;
  23. }
複製代碼

TOP

返回列表