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

TOP

返回列表