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

  4. int main()
  5. {
  6.     cout << "生" << endl;
  7.     _sleep(300);
  8.     system("cls");
  9.     cout << "  日" << endl;
  10.     _sleep(300);
  11.     system("cls");
  12.     cout << "    快" << endl;
  13.     _sleep(300);
  14.     system("cls");
  15.     cout << "      樂" << endl;
  16.     _sleep(300);
  17.     system("cls");
  18.     cout << "生日快樂" << endl;
  19.     _sleep(300);
  20.     system("cls");
  21.     system("pause");
  22.     return 0;
  23. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string food[]={"漢堡","牛排","羊肉爐","意麵","大便","餿水"};
  7.     srand(time(NULL));
  8.     while(true)
  9.     {
  10.     cout<<"☆★☆抽籤程式☆★☆"<<endl;
  11.     cout<<"今晚吃甚麼?"<<endl;
  12.     system("pause");
  13.     system("cls");
  14.     for(int i=1;i<=30;i++)
  15.     {
  16.             if(i%2!=0)
  17.             {
  18.                       cout<<"☆★☆抽籤中☆★☆"<<endl;
  19.                       cout<<food[rand()%6]<<"!";
  20.             }
  21.             if(i%2==0)
  22.             {
  23.                       cout<<"★☆★抽籤中★☆★"<<endl;
  24.                       cout<<food[rand()%6]<<"!";
  25.             }
  26.             _sleep(55+i);
  27.             system("cls");
  28.     }
  29.     cout<<"吃"<<food[rand()%6]<<"!"<<endl;
  30.     system("pause");
  31.     }
  32.     system("pause");   
  33.     return 0;
  34. }
複製代碼

TOP

返回列表