VB编程:S=1!+2!+3!+4!+5!+6!+7!+8!+9!+10!

如题所述

第1个回答  2009-03-20
dim i,j=1,s=0
for i=1 to 10
j=j*i
s=s+j
next

print s

具体自己再看看,就是这个思想,很简答的,本回答被提问者和网友采纳
第2个回答  2009-03-20
Private Sub Command1_Click()
For i = 1 To 10
n = 1
For k = 1 To i
n = n * k
Next k
s = s + n
Next i
Print s
End Sub
第3个回答  2009-03-20
dim s,t as long
s=0

for i=1 to 10
t=1
for j=1 to i
t=t*j
next
s=s+t
next

msgbox s
第4个回答  2009-03-20
Private Sub Form_Load()
Me.AutoRedraw = True
Dim i As Integer
Dim j As Long
Dim s As Long
j = 1
s = 0
For i = 1 To 10
j = j * i
s = s + j
Next i
Print s
End Sub

求1!+2!+3!+4!+5!+6!+7!+8!+9!+10!的值,用VB编写程序!求代码!
End Function Private Sub Command1_Click()Dim SumAdd As Long, i For i = 1 To 10 SumAdd = SumAdd + jc(i)Next Print SumAdd End Sub

VB中的阶乘累加求和1!+2!+3!+4!+5!+6!+7!+8!+9!+10!=?
Private Sub Form_Load()Dim i As Integer, j As Integer, sum As Long, jiech As Long sum = 0 For i = 1 To 10 '求和数 jiech = 0 '求阶乘时赋初始值0 For j = 1 To i '求i的阶乘 jiech = jiech + jiech * i Next j sum = sum + jiech '阶乘求和 Next i Prin...

VB程序:求S=1!+2!+3!+4!+5!+6!+7!+8!+……+99!的值是多少?
99的阶乘接近10的156次方,也就是说,是一个155位的数值,这个数值在VB的数值类型中,是无法精确存储的。一般算法类型的编程题目,会求这个值的后6位这样的问题,或者使用贪心算法计算阶乘和问题,这类问题通常不会超过10的阶乘值或者整数变量范围。s=0 for i= 1 to 99 for j=1 to i s1=1 s1...

vb 显示1+2+3+4+5+6+7+8+9+10=55
放置三个控件:text1,command1,其它就靠程序自己运行啦!注意窗口要足够宽哟,否则可能会造成运行时显示不完整昂。代码如下:Private Sub Command1_Click()Cls Dim a As Single, b As Integer, i As Integer If Not IsNumeric(Text1.Text) Then Print "请输入数字"Else a = Val(Text1.Text)...

试用VB程序语言写出主要程序段:求S=1+3+5+7+……+999的值。
(1)Private Sub Command1_Click()Dim x As Integer, i As Integer x = Val(Text1.Text)If x > 1 Then For i = 2 To x - 1 If x Mod i = 0 Then Exit For Next i If i = x Then MsgBox x & "是素数"Else MsgBox x & "不是素数"End If Else MsgBox "x必须大于1"End ...

怎么写vb的阶乘代码
= s * i Next i Label4.Caption = Str(s)End Sub 2、Do While语句实现 Private Sub Command1_Click()Dim s As Long, n As Integer, i As Integer n = Val(Text1.Text)s = 1 i = 1 Do While i <= n s = s * i i = i + 1 Loop Label4.Caption = Str(s)End Sub ...

在C语言中 语句 printf("%d%d%%d%d",1+2,5\/2,-2*4,11%3)是怎样...
先算1+2=3,这个没什么要说的 再计算 5\/2=2(整型数与整型数计算,结果也为整型数.5\/2=2.5,取整得2)再计算 -2*4=-8,这个也没什么要说的 最后 11%3=2(11\/3取余数) 关于取余计算.我想说一下,就是只有整型数才能进行取余计算. 特殊情况,如果M小于N,M%N=M.输出框输出的是32...

VB期末考试
s = 0 For i = 0 To 15 X = 2 * i - 1 If X Mod 3 = 0 Then s = s + 1 Next i Label1.Caption = sEnd Sub程序运行后,单击命令按钮,则标签中显示的内容为A)1 B)5 C)27 D)45B4.在窗体上画一个名称为Command1的命令按钮,一个名称为Label1、Label2、Label3的标签,然后编写如下的事件...

vb编程s=1+1×2+1×2×3+1×2×3×4……1×2×3×4×5×6×7×8×9...
Private Sub Command1_Click()Dim S1 As Long Dim SS As Long For i = 1 To 10 S1 = 1 For j = i To 1 Step -1 S1 = S1 * j Next j SS = SS + S1 Next i End Sub

求VB程序代码 1!+2!……20!的和
If src(i) > 9 Then If i = UBound(src) Then ReDim Preserve src(i + 1)End If src(i + 1) = src(i + 1) + src(i) \\ 10 src(i) = src(i) Mod 10 End If Next End Sub '主程序 Sub Main()Dim i As Integer Dim MDigit() As Integer Dim Sum() As Integer ReDim...

相似回答