以下程序用于求S=1+3+32+33+…+310的值。
Private Sub Commandl_Click()
S=1
T=1
ForI=1 To 10
T=______
S=S+T
NextI
Print"S=";S
End Sub
第1题:
下列程序的功能是:求1到10的阶乘的和,请完善程序。 #include <stdio.h> int main () { int n,j,s=0,t; for(n=1;n<=10;n++) { ; for(j=1;j<=n;j++) t=t*j; s=s+t; } printf("s=%dn",s); return 0; }
第2题:
18、/*程序的功能是:求1到10的阶乘的和*/ #include "stdio.h" int main () { int n,j,s=0,t; for(n=1;n<=10;n++) { ; for(j=1;j<=n;j++) t=t*j; s=s+t; } printf("s=%d\n",s); return 0; }
第3题:
/*程序的功能是:求1到10的阶乘的和*/ #include "stdio.h" int main () { int n,j,s=0,t; for(n=1;n<=10;n++) { ; for(j=1;j<=n;j++) t=t*j; s=s+t; } printf("s=%dn",s); return 0; }
第4题:
若有以下程序,当程序运行后,单击命令按钮,则输出的结果为( )。 Private Sub Command1_Click() Dim a%(1 To 4), b%(3 To 6), i%, s1#, s2# For i= 1 To 4 a(i) = i Next i For i=3 To 6 b(i) = i Next i s1 = Factorial (A) s2 = Factorial (B) Print "s1="; s1; "s2="; s2 End Sub Function Factorial(a() As Integer) Dim t#, i% t=1 For i = LBound(A)To UBound(A) t = t * a(i) Next i Factorial = t End Function
A.s1=360 s2=24
B.s1=24 s2=360
C.s1=24 s2=24
D.s1=360 s2=360
第5题:
以下程序用于求s=1+(1+2)+(1+2+3)+……(1+2+……100)的和,请补充完该程序。
Dim n As Integer
Dim i As Integer
Dim j As Long
Dim s As Long
n=100
j=0
s=0
For i=1 To【 】
J=【 】
s=【 】
Next i
Print s
第6题:
以下程序求1!+2!+3!+…+10!的累加和,请为下面的程序选择正确的答案
s=0
FOR i=1 TO 10
t=1
FOR j=1 TO ______
t=t*j
NEXT
s=s+t
NEXT
? S
A.10
B.j
C.9
D.i
第7题:
以下程序是计算1 - 1/2 + 1/3 - 1/4 + … + 1/9 - 1/10 的值并输出,请补充完整。
S=0
K=1
T=1
DO WHINE K<【 】
S=S+T/K
K=K+1
T= -T
LOOP
MSGBOX S
第8题:
【程序说明】程序功能是求1!+2!+3!+…+10!的累加和。
【程序】
SET TALK OFF
S=0
FOR i=1 TO 10
t=1
FOR j=1 TO (5)
t=t*j
(6)
s=s+ t
NEXT
(7)
SET TALK ON
(5)
A.10
B.j
C.9
D.i
第9题:
以下程序求1!+2!+3!+…+10!的累加和,请为下面的程序选择正确的答案 s=0 FOR i=1 TO 1 0 t=1 FOR j=1 TO____t=t*jNEXTs=s+tNEXT? SA) 10 B)j C)9 D)i