作业帮 > 综合 > 作业

vb中用for、do…loop和while…wend循环三种形式分别求3的n次方

来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/23 18:51:48
vb中用for、do…loop和while…wend循环三种形式分别求3的n次方
vb中用for、do…loop和while…wend循环三种形式分别求3的n次方
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer = 1, n As Integer
Dim sum As Integer = 1
n = InputBox("请输入一个整数")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''for循环
'For i = 1 To n Step 1
' sum = sum * 3
'Next
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''while循环
'While i