小程序商品结算计算总和
#include<iostream.h>
#include<conio.h>
#include<conio.h>
void main()
{
clrscr();
int n,i;
long sum=0;
cout<<“1^2+3^2+5^2+……+n^2nn Enter Value of n:”;
cin>>n;
for(i=1;i<=n;i+=2)
sum+=(i*i);
cout<<“n Sum of given series is “<<sum;
getch();
}
翻译自: https://www.thecrazyprogrammer.com/2011/08/c-program-to-find-sum-of-series-123252n2.html
小程序商品结算计算总和