返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string n[]={"漢堡","三明治","炒飯","吐司夾蛋","披薩"};
  7.     srand(time(NULL));
  8.     cout<<"☆★☆抽籤程式☆★☆"<<endl;
  9.     cout<<"今天中午要吃什麼?"<<endl;
  10.     system("pause");  
  11.     system("cls");
  12.     for(int i=1;i<=50;i++)
  13.     {
  14.          if(i%2==1)
  15.              cout<<"☆★☆抽籤中☆★☆"<<endl;
  16.          else
  17.              cout<<"☆★☆抽籤中☆★☆"<<endl;
  18.              cout<<"吃"<<n[rand()%5]<<endl;
  19.              if(i<30)
  20.                  _sleep(20);
  21.              else
  22.                  _sleep(20+(i-30)*(i-30));   
  23.          system("cls");           
  24.     }
  25.     cout<<"吃:"<<n[rand()%5]<<endl;
  26.     system("pause");
  27.     return 0;   
  28. }
複製代碼

TOP

返回列表