返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n;
  7.     string d[5]={"飯","麵","粥","漢堡","火鍋"};
  8.     srand(time(NULL));
  9.     cout<<"☆★☆抽籤程式☆★☆"<<endl;
  10.     cout<<"今晚要吃什麼?(按Enter鍵開始抽籤)"<<endl;
  11.     system("pause");
  12.     system("cls");
  13.     for(int i=0;i<=150;i++)
  14.     {
  15.          n=rand()%5;
  16.          if(i%2==0)
  17.          {
  18.               cout<<"☆★☆抽籤中☆★☆"<<endl;
  19.          }
  20.          else
  21.          {
  22.               cout<<"★☆★抽籤中★☆★"<<endl;
  23.          }
  24.          cout<<d[n]<<endl;
  25.          system("cls");
  26.     }
  27.     cout<<"今晚吃"<<d[n]<<"!"<<endl;
  28.     system("pause");
  29.     return 0;   
  30. }
複製代碼

TOP

返回列表