返回列表 發帖
  1. #include<cstdlib>
  2. #include<iostream>
  3. #include<ctime>
  4. using namespace std;

  5. int main()
  6. {
  7.     srand(time(NULL));
  8.     string food[]={"漢堡","牛排","羊肉爐","意麵","大便","餿水"};
  9.    
  10.     cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
  11.     cout<<"今天晚餐\吃什麼?"<<endl;
  12.     system("pause");
  13.     for (int i=0;i<=100;i++)
  14.     {
  15.         if(i%2==0)
  16.         {
  17.           cout<<"★☆★ 抽籤中 ★☆★"<<endl;      
  18.         }
  19.         else if(i%2==1)
  20.         {
  21.           cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;  
  22.             
  23.         }
  24.         cout<<"吃"<<food[rand()%5] <<endl;
  25.         _sleep(100);
  26.         
  27.         system("cls");

  28.     }
  29.    
  30.     system("pause");   
  31.     return 0;
  32. }
複製代碼

TOP

返回列表