- #include<iostream>
- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- re:
- int speed=50;
- srand(time(NULL));
- for(int i=1; i<=10; i++)
- {
- system("cls");
- if(i==1)
- cout<<"■□□□□□□□□□"<<endl;
- if(i==2)
- cout<<"■■□□□□□□□□"<<endl;
- if(i==3)
- cout<<"■■■□□□□□□□"<<endl;
- if(i==4)
- cout<<"□■■■□□□□□□"<<endl;
- if(i==5)
- cout<<"□□■■■□□□□□"<<endl;
- if(i==6)
- cout<<"□□□■■■□□□□"<<endl;
- if(i==7)
- cout<<"□□□□■■■□□□"<<endl;
- if(i==8)
- cout<<"□□□□□■■■□□"<<endl;
- if(i==9)
- cout<<"□□□□□□■■■□"<<endl;
- if(i==10)
- cout<<"□□□□□□□■■■"<<endl;
- _sleep(speed);
- }
- goto re;
- system("pause");
- return 0;
- }
複製代碼 |