返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. using namespace std;
  5. int main()
  6. {
  7. string a[]={"漢堡","牛排","羊肉爐","意麵","大便","餿水"};
  8. srand(time(NULL));
  9. re:
  10. system("cls");
  11. cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
  12. cout<<"今天晚餐吃什麼?"<<endl<<endl;

  13. system("pause");
  14. for(int i=1; i<=50; i++)
  15.    {
  16.         if(i%2==1)
  17.             cout<<"★☆★ 抽籤中 ★☆★"<<endl;
  18.         else
  19.             cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
  20.         cout<<a[rand()%6]<<"!"<<endl;
  21.         _sleep(20);
  22.         system("cls");
  23.    }
  24. cout<<"吃"<<a[rand()%6]<<"!"<<endl;

  25. system("pause");
  26. return 0;
  27. }
複製代碼

TOP

返回列表