返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     for(int i=1; i<=1000; i++)
  7.     {
  8.          if(i/5<=9)   
  9.          cout<<"  "<<i/5<<"%"<<endl;   
  10.          else if(i/5>9&&i/5<=99)
  11.          {   
  12.          cout<<" "<<i/5<<"%"<<endl;
  13.          }   
  14.          else
  15.          {  
  16.          cout<<i/5<<"%"<<endl;
  17.          }
  18.          system("cls");
  19.     }
  20.     cout<<"100% 完成!"<<endl;
  21.     system("pause");
  22.     return 0;   
  23. }
複製代碼

TOP

返回列表