返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    srand(time(NULL));
  7.    string food[]={"漢堡", "牛排", "炒飯", "意麵", "大便"};
  8.    cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
  9.    cout<<"今天晚餐\吃甚麼?"<<endl;
  10.    system("pause");                     
  11.    for(int i=1; i<=50; i++)
  12.    {
  13.        if(i%2==1)
  14.            cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
  15.        else
  16.            cout<<"★☆★ 抽籤中 ★☆★"<<endl;
  17.        cout<<food[rand()%5]<<endl;
  18.        system("cls");
  19.    }
  20.    cout<<"吃"<<food[rand()%5]<<endl;
  21.    system("pause");   
  22.    return 0;
  23. }
複製代碼

TOP

返回列表