- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- for(int i=0;i<=100;i++)
- {
- if(i<=0)
- cout<<i<<"%\t載入中 □□□□□□□□□□"<<endl;
- if(i<=10)
- cout<<i<<"%\t載入中 □□□□□□□□□□"<<endl;
- if(i<=20 && i>10)
- cout<<i<<"%\t載入中 ■□□□□□□□□□"<<endl;
- if(i<=30 && i>20)
- cout<<i<<"%\t載入中 ■■□□□□□□□□"<<endl;
- if(i<=40 && i>30)
- cout<<i<<"%\t載入中 ■■■□□□□□□□"<<endl;
- if(i<=50 && i>40)
- cout<<i<<"%\t載入中 ■■■■□□□□□□"<<endl;
- if(i<=60 && i>50)
- cout<<i<<"%\t載入中 ■■■■■□□□□□"<<endl;
- if(i<=70 && i>60)
- cout<<i<<"%\t載入中 ■■■■■■□□□□"<<endl;
- if(i<=80 && i>70)
- cout<<i<<"%\t載入中 ■■■■■■■□□□"<<endl;
- if(i<=90 && i>80)
- cout<<i<<"%\t載入中 ■■■■■■■■□□"<<endl;
- if(i<=99 && i>90)
- cout<<i<<"%\t載入中 ■■■■■■■■■□"<<endl;
- if(i==100)
- cout<<i<<"%\t完成! ■■■■■■■■■■"<<endl;
- _sleep(90);
- if(i==100)
- break;
- system("cls");
- }
- system("pause");
- return 0;
- }
複製代碼 |