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

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


  21.    system("pause");
  22.    return 0;
  23. }
複製代碼

TOP

返回列表