作业帮 > 综合 > 作业

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

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/06/08 21:55:50
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