返回列表 發帖

while 迴圈

本帖最後由 tonyh 於 2013-3-30 15:17 編輯

50~60
  1. //while 迴圈  50~60
  2. #include<iostream>
  3. #include<cstdlib>
  4. using namespace std;
  5. int main()
  6. {
  7.     int i=50;
  8.     while(i<=60)
  9.     {
  10.         cout<<i<<endl;
  11.         i++;   
  12.     }
  13.    
  14.     /*
  15.     for(int i=50; i<=60; i++)
  16.     {
  17.          cout<<i<<endl;
  18.     }
  19.     */
  20.    
  21.     system("pause");
  22.     return 0;   
  23. }
複製代碼

返回列表