编写一个程序,计算S=1+1/2²+1/3²+。。。+1/n²
来源:百度知道 编辑:UC知道 时间:2024/05/31 21:03:21
n=InputBox("请输入n:","提示","10")
s=1
For j = 2 To n
s=s+1/j^2
Next
WScript.Echo s
代码另存为code.vbs运行即可。
#include<stdio.h>
#include <conio.h>
void main()
{
int n,i;
double temp;
printf("input n:");
scanf("%d",&n);
i= n + 1;
temp= 0;
while (--i)
{
temp+=1.0/(i*i);
}
printf("Result is %f",temp);
getch();
}
编写程序,计算和式: S=-1!+2!-3!+4! - …… + 10! 。 要求用循环语句实现。
C语言求助:怎么编写一个程序求S=1!+2!+…9!+10!。
vfp程序 s=1+2+…… 怎么编写
编写一个过程,用来计算输出s=1+2分之一+3分之一+4分之一+、、、、、+100分之一
用VFP编写程序,计算数列前40项之和:S=1/1+2/2+4/3+7/4+11/5...
编写程序(Lib5.cpp),计算 1! + 2! + 3! +.... + N! 。要求:编写一个函数,参数设置为值参数。
编写一个程序用于计算1 到100 之间偶数之和
编写程序计算并输出S=5+10+45+20+.......2000的值
编写一个程序,从键盘输入X,Y,Z3个数,编写函数计算3个数的立方和并返回计算结果:S=X*X*X+Y*Y*Y+Z*Z*Z
计算s=1!+2!+3!+.....+7!? 用VC编写谢谢?