ppts.net
当前位置:首页>>关于s=1/(1+2+3)-2/(2+3+4)+3/(3+4+5)-4/(4+5+6)+……前2...的资料>>

s=1/(1+2+3)-2/(2+3+4)+3/(3+4+5)-4/(4+5+6)+……前2...

把分子写成分母的最大数减1 ,得 原式=(2-1)/(1*2)+(3-1)/(1*2*3)+(4-1)/(1*2*3*4)+(5-1)/(1*2*3*4*5) =[2/(1*2)-1/(1*2)]+[3/(1*2*3)-1/(1*2*3)]+[4/(1*2*3*4)-1/(1*2*3*4)]+[5/(1*2*3*4*5)-1/(1*2*3*4*5)] =[1/1-1/(1*2)]+[1/(1*2)-1/(1*2*3)]...

main(){ int k,flag=1,n;float s=0;scanf("%d",&n);for(k=1;k

你会写1+2+3+4+5吧,如下:float s=0;for(float i = 1; i

核心代码 int i; double s; int[] b = new int[10]; b[0] = 1; b[1] = 1; for(int j = 2; j

int k=-1,s=0; for(int i=1;i

Private Sub Command1_Click() Dim n As Integer, Sum As Double n = InputBox("n=") For i = 1 To n Sum = Sum + i / (2 * i - 1) Next i Print "Sum(i=1 to " & n & ")[i/(2i+1))]="; SumEnd Sub

#includevoid main(){double s=0,fm;for(int i=0;i

为此题提供两种做法:一是把此数列连续的奇数项和偶数项结合起来构成一个新数列,它就变成-1,-1,-1,...,-1共50项这样一个数列,C编程当然就很简单了。另一种是用一个for循环遍历1~100,计数变量为奇数时向和累加计数变量的值,而计数变量为...

#include void fun( int n ) //要传参数!!{int i;double j;double s=1;for(i=2;i

float Unit(int iIn) //计算一个单元 { int iA,iB; float fRet; iA=0; for(int i=1;i0;i--) { iB=iB*i; } fRet=(float)iA/iB; if(i%2==0) { fRet=fRet*-1; } return fRet; } //调用下面函数返回计算结果 float myFun() { float fRet; fRet=0; fo...

网站首页 | 网站地图
All rights reserved Powered by www.ppts.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com