VB程序改错题
计算阶乘”按钮单击功能为:文本框Text2中输入数字,图片框中显示计算的结果。PrivateSubCommand2_Click()DimIAsInteger,NAsInt...
计算阶乘”按钮单击功能为:文本框Text2中输入数字,图片框中显示计算的结果。
Private Sub Command2_Click()
Dim I As Integer, N As Integer, Fac As Single
N = val(Text2.Text)
Fac = 0
I = 0
While I < N
Fac = Fac * I
I = I + 1
Wend
Picture1.print N & "的阶乘:" & I 展开
Private Sub Command2_Click()
Dim I As Integer, N As Integer, Fac As Single
N = val(Text2.Text)
Fac = 0
I = 0
While I < N
Fac = Fac * I
I = I + 1
Wend
Picture1.print N & "的阶乘:" & I 展开
3个回答
展开全部
上面的人回答不仔细啊
Private Sub Command2_Click()
Dim I As Integer, N As Integer, Fac As Single
N = val(Text2.Text)
Fac = 1
I = 1
While I <= N '加个等号
Fac = Fac * I
I = I + 1
Wend
Picture1.print N & "的阶乘:" & Fac
End Sub
Private Sub Command2_Click()
Dim I As Integer, N As Integer, Fac As Single
N = val(Text2.Text)
Fac = 1
I = 1
While I <= N '加个等号
Fac = Fac * I
I = I + 1
Wend
Picture1.print N & "的阶乘:" & Fac
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command2_Click()
Dim I As Integer, N As Integer, Fac As Single
N = val(Text2.Text)
Fac = 1 '此处应该改为1,否则无论怎么乘都是0
I = 1 '这里也是1
While I <= N '加个等号
Fac = Fac * I
I = I + 1
Wend
Picture1.print N & "的阶乘:" & I
Dim I As Integer, N As Integer, Fac As Single
N = val(Text2.Text)
Fac = 1 '此处应该改为1,否则无论怎么乘都是0
I = 1 '这里也是1
While I <= N '加个等号
Fac = Fac * I
I = I + 1
Wend
Picture1.print N & "的阶乘:" & I
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command2_Click()
Dim I As Integer, N As Integer,Fac As Single
fac = 1
N = val(Text2.Text)
for i = 1 to n
fac =fac *i
next i
Picture1.print N & "的阶乘:" & fac
Dim I As Integer, N As Integer,Fac As Single
fac = 1
N = val(Text2.Text)
for i = 1 to n
fac =fac *i
next i
Picture1.print N & "的阶乘:" & fac
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询