返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<time.h>
  4. using namespace std;
  5. int main()
  6. {
  7.     srand(time(NULL));
  8.     int food=0;
  9.     cout<<"今天晚上吃啥"<<endl;
  10.     string a[]={"雞肉","牛排","漢堡","豬腳","義大利麵","鵝肉","鴨肉","法國土司","薯條","炸雞"};
  11.     food=(rand()%9)+1;
  12.     cout << "今天吃:" << a[food-1] << endl;
  13.     system("pause");
  14.     return 0;
  15. }
複製代碼

TOP

返回列表