- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- int speed=200;
- srand(time(NULL));
- for(int i=0; i<=10; i++)
- {
- system("cls");
- if(i==0)
- cout<<" 0% 載入中 □□□□□□□□□□"<<endl;
- if(i==1)
- cout<<" 10% 載入中 ■□□□□□□□□□"<<endl;
- if(i==2)
- cout<<" 20% 載入中 ■■□□□□□□□□"<<endl;
- if(i==3)
- cout<<" 30% 載入中 ■■■□□□□□□□"<<endl;
- if(i==4)
- cout<<" 40% 載入中 ■■■■□□□□□□"<<endl;
- if(i==5)
- cout<<" 50% 載入中 ■■■■■□□□□□"<<endl;
- if(i==6)
- cout<<" 60% 載入中 ■■■■■■□□□□"<<endl;
- if(i==7)
- cout<<" 70% 載入中 ■■■■■■■□□□"<<endl;
- if(i==8)
- cout<<" 80% 載入中 ■■■■■■■■□□"<<endl;
- if(i==9)
- cout<<" 90% 載入中 ■■■■■■■■■□"<<endl;
- if(i==10)
- cout<<"100% 載入中 ■■■■■■■■■■"<<endl;
- _sleep(speed);
- }
- system("pause");
- return 0;
- }
複製代碼 |