返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n;
  7.     string f[]={"湯","飯","肉","麵","菜","水果"};
  8.     cout<<"☆★☆抽籤程式☆★☆"<<endl;
  9.     cout<<"今晚你要吃什麼"<<endl;
  10.     system("cls");
  11.     srand(time(NULL));
  12.     for(int i=1;i<200;i++)
  13.     {

  14.      n=rand()%5;
  15.      if(i%2==0)
  16.      cout<<"☆★☆抽籤程式☆★☆"<<endl;
  17.      else
  18.      cout<<"★☆★抽籤中★☆★"<<endl;
  19.      cout<<f[n]<<endl;
  20.      system("cls");      
  21.     }
  22.     cout<<"☆★☆抽籤程式☆★☆"<<endl;
  23.     cout<<f[n]<<endl;
  24.    
  25.    
  26.    
  27.    
  28.    
  29.     system("pause");
  30.     return 0;   
  31.    
  32. }
複製代碼

TOP

返回列表