返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    int speed=(150);
  7.    for(int i=1; i<=100; i++)
  8.    {
  9.        cout<<i<<"% 載入中 ";
  10.        if(i<10)
  11.        cout<<"□□□□□□□□□□"<<endl;
  12.        else if(i<20)
  13.        cout<<"■□□□□□□□□□"<<endl;
  14.        else if(i<30)
  15.        cout<<"■■□□□□□□□□"<<endl;
  16.        else if(i<40)
  17.        cout<<"■■■□□□□□□□"<<endl;
  18.        else if(i<50)
  19.        cout<<"■■■■□□□□□□"<<endl;
  20.        else if(i<60)
  21.        cout<<"■■■■■□□□□□"<<endl;
  22.        else if(i<70)
  23.        cout<<"■■■■■■□□□□"<<endl;
  24.        else if(i<80)
  25.        cout<<"■■■■■■■□□□"<<endl;
  26.        else if(i<90)
  27.        cout<<"■■■■■■■■□□"<<endl;
  28.        else(i<100)
  29.        cout<<"■■■■■■■■■□"<<endl;
  30.        _sleep(speed);
  31.        system("cls");
  32.        }
  33.       
  34.        cout<<"100% 完成 ■■■■■■■■■■"<<endl;
  35.    system("pause");   
  36.    return 0;
  37. }
複製代碼

TOP

返回列表