返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<time.h>
  4. using namespace std;
  5. int main()
  6. {         
  7.     int num = 0;
  8.     cout<<"☆★☆抽籤程式☆★☆"<<endl;
  9.     cout<<"===================="<<endl;
  10.     cout<<"★今天晚上要吃什麼★"<<endl;      
  11.     string j[]=
  12.     {
  13.         "豬肉",
  14.         "牛肉",
  15.         "雞肉",
  16.         "羊肉",
  17.         "鴨肉",
  18.         "泡麵",
  19.         "漢堡",
  20.         "薯條",
  21.         "雞塊",
  22.         "餅乾",
  23.     };
  24.     srand(time(NULL));
  25.     num=(rand()%10)+1;
  26.     cout<<endl;
  27.     cout<<"~今天晚上吃"<<j[num-1]<<"好了~"<<endl;
  28.     cout<<endl;
  29.     system("pause");
  30.     return 0;   
  31. }
複製代碼

TOP

返回列表