返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. using namespace std;
  5. int main()
  6. {
  7.     srand(time(NULL));
  8.     string f[]={"空氣","大便","杯子","盤子","湯匙"};
  9.     cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl<<endl;
  10.     cout<<"今天晚餐\吃什麼?"<<endl<<endl;
  11.     system("pause");
  12.     for(int i=0; i<=30; i++)
  13.     {
  14.         if(i%2==1)
  15.             cout<<"★☆★ 抽籤中 ★☆★"<<endl;
  16.         else
  17.             cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
  18.         cout<<f[rand%6]<<"!"<<endl;
  19.         _sleep(50);
  20.         system("cls");      
  21.     }
  22.     cout<<"吃"<<f[rand%6]<<"!"<<endl<<endl;
  23.     system("pause");
  24.     return 0;   
  25. }
複製代碼

TOP

返回列表