返回列表 發帖
本帖最後由 林家鉌 於 2023-7-9 21:55 編輯
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.         int a,b=0,c=0;
  6.         cout<<"pls input a number: ";
  7.         cin>>a;
  8.         while(c<1000)
  9.         {
  10.                 b=b+c;
  11.                 c+=a;
  12.         }
  13.         cout<<"\n"<<b;
  14.         system("pause");
  15.         return 0;
  16. }
複製代碼

TOP

返回列表