求VB编程2-100求和FOR DO WHILE都要FOR DO WHILE都分别要的哦

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/24 01:48:37
求VB编程2-100求和FORDOWHILE都要FORDOWHILE都分别要的哦求VB编程2-100求和FORDOWHILE都要FORDOWHILE都分别要的哦求VB编程2-100求和FORDOWHI

求VB编程2-100求和FOR DO WHILE都要FOR DO WHILE都分别要的哦
求VB编程2-100求和FOR DO WHILE都要
FOR DO WHILE都分别要的哦

求VB编程2-100求和FOR DO WHILE都要FOR DO WHILE都分别要的哦
Function GetSumByFor() As Integer
Dim i As Integer, s As Integer
s = 0

For i = 2 To 100
s = s + i
Next

GetSumByFor = s
End Function
Function GetSumByWhile() As Integer
Dim i As Integer, s As Integer
i = 2
s = 0

Do While i