返回列表 發帖

跑馬燈 (二)

本帖最後由 tonyh 於 2013-9-7 15:20 編輯

以5倍的速度放慢
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int j=0;
  7.     for(int i=1;i<=500;i++)
  8.     {
  9.         if(i%5==0)
  10.             j++;
  11.         cout<<j<<"%"<<endl;
  12.         system("cls");   
  13.     }   
  14.     cout<<"100% 完成!"<<endl;
  15.     system("pause");
  16.     return 0;
  17. }
複製代碼
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     for(int i=1; i<=500; i++)
  7.     {
  8.          cout<<i/5<<"%"<<endl;
  9.          system("cls");
  10.     }
  11.     cout<<"完成!"<<endl;
  12.     system("pause");
  13.     return 0;  
  14. }
複製代碼

返回列表