返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    int speed,tmp;
  7.    cout<<"請輸入廣告刊版的出現倍率:";
  8.    cin>>speed;
  9.    for(int i=1;i<=120*speed;i++)
  10.    {
  11.          tmp=i/speed;
  12.          if(tmp>=1 && tmp<=10)
  13.          {
  14.           cout<<"歡";
  15.          }
  16.           if(tmp>=11 && tmp<=20)
  17.          {
  18.           cout<<" 光";
  19.          }
  20.          if(tmp>=21 && tmp<=30)
  21.          {
  22.           cout<<"  光";
  23.          }            
  24.          if(tmp>=31 && tmp<=40)
  25.          {
  26.           cout<<"   臨";
  27.          }         
  28.          if(tmp>=41 && tmp<=50)
  29.          {
  30.           cout<<"歡";
  31.          }  
  32.          if(tmp>=51 && tmp<=60)
  33.          {
  34.           cout<<"歡迎";
  35.          }  if(tmp>=61 && tmp<=70)
  36.          {
  37.           cout<<"歡迎光";
  38.          }            
  39.          if(tmp>=71 && tmp<=80)
  40.          {
  41.           cout<<"歡迎光臨";
  42.          }  
  43.          if(tmp>=81 && tmp<=90)
  44.          {
  45.           cout<<" ";
  46.          }  
  47.          if(tmp>=91 && tmp<=100)
  48.          {
  49.           cout<<"歡迎光臨";
  50.          }  
  51.          if(tmp>=101 && tmp<=110)
  52.          {
  53.           cout<<" ";
  54.          }   
  55.          if(tmp>=111 && tmp<=120)
  56.          {
  57.           cout<<"歡迎光臨";
  58.          }
  59.          system("cls");                     
  60.    }
  61.     system("pause");
  62.     return 0;
  63. }
複製代碼

TOP

返回列表