vb 求 1×2×3×.×99×100=
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/20 08:20:55
vb 求 1×2×3×.×99×100=
Private Sub Form_Click()
Dim i As Integer
Dim sum As Integer
sum = 1
For i = 1 To 100 Step 1
sum = sum * i
Next i
End Sub
这个有什么问题啊?
Private Sub Form_Click()
Dim i As Integer
Dim sum As Integer
sum = 1
For i = 1 To 100 Step 1
sum = sum * i
Next i
End Sub
这个有什么问题啊?
sum定义为整型肯定会溢出的
必须定义为double
Private Sub CommandButton1_Click()
Dim i As Integer
Dim sum As Double
sum = 1
For i = 1 To 100 Step 1
sum = sum * i
Next i
TextBox1.Text = sum
End Su
必须定义为double
Private Sub CommandButton1_Click()
Dim i As Integer
Dim sum As Double
sum = 1
For i = 1 To 100 Step 1
sum = sum * i
Next i
TextBox1.Text = sum
End Su
vb 求 1×2×3×.×99×100=
求s=1-1/2+1/3-1/4+..+1/99-1/100的值 用vb程序编写
用VB求S=1!+2!+3!+……+99!
vb编程.会的来.感激不尽~vb 【循环结构】编程计算【s=1+2+3++100的值】
试用VB程序语言写出主要程序段:求S=1!+2!+3!+……+99!的值
VB编程实现s=1-2+3-4+...+97-98+99-100的计算
VB程序题1.求S=1+3+5+7+---+99的值.
vb编程实现求sum=1/1!+1/2!+1/3!+ +1/n! (n
VB 利用for each...next循环语句,求 1+2+3+...+100的值 .
VB循环语句求s=1+3+5+……+2n-1的值
vb编程:求a=1+3+5+.+(2n-1)的值
VB编程~求s=1!+2!+3!+4!+……+10!