C语言:求s=1/2!+1/4!+1/6!+1/8!+1/10!的值,咋编程?
1个回答
关注
展开全部
亲,您好,很高兴为您解答,C语言:求s=1/2!+1/4!+1/6!+1/8!+1/10!的值代码文本:#include "stdio.h"int main(int argc,char *argv[]){double s,t;int i;for(s=0,t=i=1;i<10;s+=t/=(i*i+i++),i++);printf("The result are %g\n",s);return 0;}
咨询记录 · 回答于2022-11-24
C语言:求s=1/2!+1/4!+1/6!+1/8!+1/10!的值,咋编程?
亲,您好,很高兴为您解答,C语言:求s=1/2!+1/4!+1/6!+1/8!+1/10!的值代码文本:#include "stdio.h"int main(int argc,char *argv[]){double s,t;int i;for(s=0,t=i=1;i<10;s+=t/=(i*i+i++),i++);printf("The result are %g\n",s);return 0;}