返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.         int a,b=0,c=0;
  7.         cout<<"input a number pls: ";
  8.         cin>>a;
  9.         for(;b<=1000;b=b+a)
  10.         {
  11.                 c=c+b;
  12.         }
  13.         cout<<c;
  14.         system("pause");
  15.         return 0;
  16. }
複製代碼

TOP

返回列表