返回列表 發帖
本帖最後由 田家齊 於 2022-3-5 12:00 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int r;
  7.     cin>>r;
  8.     re:
  9.    for(int i=1;i<65*r;i++)
  10.    {
  11.         if(i>=1*r+1 && i<=5*r)
  12.     cout<<"□□□□□□□□□□"<<endl;  
  13.         if(i>=5*r+1 && i<=10*r)
  14.     cout<<"■□□□□□□□□□"<<endl;
  15.         if(i>=10*r+1 && i<=15*r)
  16.     cout<<"■■□□□□□□□□"<<endl;
  17.         if(i>=15*r+1 && i<=20*r)
  18.     cout<<"■■■□□□□□□□"<<endl;
  19.         if(i>=20*r+1 && i<=25*r)
  20.     cout<<"□■■■□□□□□□"<<endl;
  21.         if(i>=25*r+1 && i<=30*r)
  22.     cout<<"□□■■■□□□□□"<<endl;
  23.         if(i>=30*r+1 && i<=35*r)
  24.     cout<<"□□□■■■□□□□"<<endl;
  25.         if(i>=35*r+1 && i<=40*r)
  26.     cout<<"□□□□■■■□□□"<<endl;
  27.         if(i>=40*r+1 && i<=45*r)
  28.     cout<<"□□□□□■■■□□"<<endl;
  29.         if(i>=45*r+1 && i<=50*r)
  30.     cout<<"□□□□□□■■■□"<<endl;
  31.         if(i>=50*r+1 && i<=55*r)
  32.     cout<<"□□□□□□□■■■"<<endl;
  33.         if(i>=55*r+1 && i<=60*r)
  34.     cout<<"□□□□□□□□■■"<<endl;
  35.         if(i>=60*r+1 && i<=65*r)
  36.     cout<<"□□□□□□□□□■"<<endl;      
  37.     system("cls");
  38.    }
  39.    goto re;
  40.     system("pause");
  41.     return 0;
  42. }
複製代碼

TOP

返回列表