返回列表 發帖
  1. #include<iostream>          //☆★◇◆□■▽▼㊣℅¯>﹤㏒
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6. int h;
  7. string name[5]={"咖哩飯","煎餃","牛肉麵","炒飯","水餃"};
  8. cout<<"∴抽籤程式∴"<<endl;
  9. cout<<"≒今晚吃甚麼≒"<<endl;
  10.   system("pause");
  11.   system("cls");
  12.    
  13. srand(time(NULL));
  14.    for(int i=1;i<=300;i++)
  15.   {
  16.   h=rand()%5;
  17.   if(i%2==0)
  18.        {
  19.            cout<<"☆★☆抽籤中☆★☆"<<endl;
  20.        }else
  21.        {
  22.            cout<<"★☆★抽籤中★☆★"<<endl;
  23.        }
  24.        cout<<name[h]<<endl;
  25.        system("cls");  
  26.   }
  27.   

  28.     cout<<"今晚選中的食物是:"<<name[h]<<endl;


  29.   system("pause");
  30. return 0;
  31. }   
複製代碼

TOP

返回列表