本帖最後由 張峻瑋 於 2014-3-29 16:44 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- for(int i=1;i<=500;i++)
- {
- if(i>=1 && i<=50)
- cout<<" "<<i/5<<"% 載入中 ▋";
- if(i>=51 && i<=100)
- cout<<" "<<i/5<<"% 載入中 ▋▋"<<endl;
- if(i>=101 && i<=150)
- cout<<" "<<i/5<<"% 載入中 ▋▋▋"<<endl;
- if(i>=151 && i<=200)
- cout<<" "<<i/5<<"% 載入中 ▋▋▋▋"<<endl;
- if(i>=201 && i<=250)
- cout<<" "<<i/5<<"% 載入中 ▋▋▋▋▋"<<endl;
- if(i>=251 && i<=300)
- cout<<" "<<i/5<<"% 載入中 ▋▋▋▋▋▋"<<endl;
- if(i>=301 && i<=350)
- cout<<" "<<i/5<<"% 載入中 ▋▋▋▋▋▋▋"<<endl;
- if(i>=351 && i<=400)
- cout<<" "<<i/5<<"% 載入中 ▋▋▋▋▋▋▋▋"<<endl;
- if(i>=401 && i<=450)
- cout<<" "<<i/5<<"% 載入中 ▋▋▋▋▋▋▋▋▋"<<endl;
- if(i>=451 && i<=500)
- cout<<" "<<i/5<<"% 載入中 ▋▋▋▋▋▋▋▋▋▋"<<endl;
- system("cls");
- }
- cout<<"100% 完成!"<<endl;
- system("pause");
- return 0;
- }
複製代碼 |