VB 高手请进来解答两个题,速度,谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/31 05:55:39
2.编写程序求级数s=1+x+x^2/2!+x^3/3!+x^4/4+.......的前100项之和,x通过用户输入。
3.找出二维数组中(n*n),每一列绝对值最大和最小的元素,并计算上三角元素的和。

2.Dim x As Integer, i As Integer, S As Single, n
x = InputBox("请输入x的值:")
S = 1
n = 1
For i = 1 To 100
n = n * i
S = S + x / n
Next i
Print S

3.dim i as integer,j as integer,max() as integer,min() as integer,s as integer
n=inputbox("请输入n的值:")
redim max(1 to n)
redim min(1 to n)
redim A(1 to n,1 to n)
for i=1 to n
max(i)=A(1,i)
min(i)=A(1,i)
for j=1 to n
if max(i)<a(j,i) then max(i)=a(j,i)
if min(i)>a(j,i) then min(i)=a(j,i)
if i+j<=n+1 then s=s+a(j,i)
next j
next i
for i=1 to n
print "第";i;"列的最大值是:";max(i)
print "第";i;"列的最小值是:";min(i)
next i
print "上三角元素的和是:";s

这个数不好定义哦!

fsf