本帖最後由 田家齊 於 2022-3-5 12:00 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int r;
- cin>>r;
- re:
- for(int i=1;i<65*r;i++)
- {
- if(i>=1*r+1 && i<=5*r)
- cout<<"□□□□□□□□□□"<<endl;
- if(i>=5*r+1 && i<=10*r)
- cout<<"■□□□□□□□□□"<<endl;
- if(i>=10*r+1 && i<=15*r)
- cout<<"■■□□□□□□□□"<<endl;
- if(i>=15*r+1 && i<=20*r)
- cout<<"■■■□□□□□□□"<<endl;
- if(i>=20*r+1 && i<=25*r)
- cout<<"□■■■□□□□□□"<<endl;
- if(i>=25*r+1 && i<=30*r)
- cout<<"□□■■■□□□□□"<<endl;
- if(i>=30*r+1 && i<=35*r)
- cout<<"□□□■■■□□□□"<<endl;
- if(i>=35*r+1 && i<=40*r)
- cout<<"□□□□■■■□□□"<<endl;
- if(i>=40*r+1 && i<=45*r)
- cout<<"□□□□□■■■□□"<<endl;
- if(i>=45*r+1 && i<=50*r)
- cout<<"□□□□□□■■■□"<<endl;
- if(i>=50*r+1 && i<=55*r)
- cout<<"□□□□□□□■■■"<<endl;
- if(i>=55*r+1 && i<=60*r)
- cout<<"□□□□□□□□■■"<<endl;
- if(i>=60*r+1 && i<=65*r)
- cout<<"□□□□□□□□□■"<<endl;
- system("cls");
- }
- goto re;
- system("pause");
- return 0;
- }
複製代碼 |