返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    string food[]={"漢堡","牛排","羊肉爐","意麵","拉麵","蛋包飯"};
  7.    srand(time(NULL));
  8.    re:
  9.    system("cls");
  10.    cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
  11.    cout<<"今天晚餐\吃什麼?"<<endl<<endl;
  12.    system("pause");
  13.    for(int i=1; i<=15; i++)
  14.    {
  15.         if(i%2==1)
  16.             cout<<"★☆★ 抽籤中 ★☆★"<<endl;
  17.         else
  18.             cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
  19.         cout<<food[rand()%6]<<endl;
  20.         _sleep(50);
  21.         system("cls");   
  22.    }
  23.    for(int i=1; i<=7; i++)
  24.    {
  25.         if(i%2==1)
  26.             cout<<"★☆★ 抽籤中 ★☆★"<<endl;
  27.         else
  28.             cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
  29.         cout<<food[rand()%6]<<endl;
  30.         _sleep(100);
  31.         system("cls");   
  32.    }
  33.    for(int i=1; i<=7; i++)
  34.    {
  35.         if(i%2==1)
  36.             cout<<"★☆★ 抽籤中 ★☆★"<<endl;
  37.         else
  38.             cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
  39.         cout<<food[rand()%6]<<endl;
  40.         _sleep(200);
  41.         system("cls");   
  42.    }
  43.    cout<<"吃: "<<food[rand()%6]<<"!"<<endl<<endl;
  44.    system("pause");
  45.    goto re;   
  46.    return 0;
  47. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    string food[]={"漢堡","牛排","羊肉爐","意麵","拉麵","蛋包飯"};
  7.    srand(time(NULL));
  8.    re:
  9.    system("cls");
  10.    cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
  11.    cout<<"今天晚餐\吃什麼?"<<endl<<endl;
  12.    system("pause");
  13.    for(int i=1; i<=50; i++)
  14.    {
  15.         if(i%2==1)
  16.             cout<<"★☆★ 抽籤中 ★☆★"<<endl;
  17.         else
  18.             cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
  19.         cout<<food[rand()%6]<<endl;
  20.         _sleep(i*3);
  21.         system("cls");   
  22.    }
  23.    cout<<"吃: "<<food[rand()%6]<<"!"<<endl<<endl;
  24.    system("pause");
  25.    goto re;   
  26.    return 0;
  27. }
複製代碼

TOP

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

TOP

返回列表