返回列表 發帖
  1. #include<iostream>
  2. #include<ctime>
  3. using namespace std;
  4. int main()
  5. {
  6.    string food[]={"漢堡","牛排","羊肉爐","意麵","大便","餿水"};
  7.    srand(time(NULL));
  8.    system("cls");
  9.    cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
  10.    cout<<"今天晚餐\吃什麼?"<<endl<<endl;
  11.    system("pause");
  12.    for(int i=1; i<=15; i++)
  13.    {
  14.        cout<<"★☆★ 抽籤中 ★☆★"<<endl;
  15.        cout<<food[rand()%6]<<"!"<<endl;
  16.        _sleep(50);
  17.        system("cls");
  18.        cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
  19.        cout<<food[rand()%6]<<"!"<<endl;
  20.        _sleep(50);
  21.        system("cls");  
  22.    }
  23.    cout<<"吃: "<<food[rand()%6]<<"!"<<endl<<endl;
  24.    system("pause");  
  25.    return 0;
  26. }
複製代碼

TOP

返回列表