返回列表 發帖
本帖最後由 吳承勳 於 2015-12-26 10:04 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6. int i = 123, ans = 0;
  7. while(i <= 456)
  8. {
  9.              ans=ans+i;
  10.              i = i + 3;         
  11.     }
  12.     cout<< ans << endl;
  13.     system("pause");
  14.     return 0;
  15. }
複製代碼

TOP

返回列表