#include<iostream>
using namespace std;
int main()
{
int i, n, sum=0;
cout << "please input n"<<endl;
cin >> n;
for (i = 1; i <= n; i++)
sum = sum+i;
cout << "sum=" << sum << endl;
return 0;
}
C++程序求简单数列和
最新推荐文章于 2024-02-04 18:41:47 发布