返回列表 發帖
本帖最後由 陳妍蓁 於 2024-7-27 14:47 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. using namespace std;
  5. int main(){

  6.     srand(time(NULL));
  7.     int speed=500;
  8.    
  9.     for(int i=1;i<=12;i++)
  10.     {
  11.     system("cls");
  12.     if(i==1)
  13.         cout<<"載入中0%□□□□□□□□□□"<<endl;
  14.     if(i==2)
  15.         cout<<"載入中10%■□□□□□□□□□"<<endl;
  16.     if(i==3)
  17.         cout<<"載入中20%■■□□□□□□□□"<<endl;
  18.     if(i==4)
  19.         cout<<"載入中30%■■■□□□□□□□"<<endl;
  20.     if(i==5)
  21.         cout<<"載入中40%■■■■□□□□□□"<<endl;
  22.     if(i==6)
  23.         cout<<"載入中50%■■■■■□□□□□"<<endl;
  24.     if(i==7)
  25.         cout<<"載入中60%■■■■■■□□□□"<<endl;
  26.     if(i==8)
  27.         cout<<"載入中70%■■■■■■■□□□"<<endl;
  28.     if(i==9)
  29.         cout<<"載入中80%■■■■■■■■□□"<<endl;
  30.     if(i==10)
  31.         cout<<"載入中90%■■■■■■■■■□"<<endl;
  32.     if(i==11)
  33.         cout<<"下載完成100%■■■■■■■■■■"<<endl;

  34.     _sleep(speed);
  35.     }

  36.    system("pause");
  37.    return 0;

  38. }
複製代碼

TOP

返回列表