i As Integer, gbs As Long, n As Integer
n = InputBox("n=")
ReDim a(n) As Integer
For i = 1 To n
a(i) = InputBox("a(" + Str(i) + ")=")
Next i
gbs = a(1)
Do
For i = 2 To n
If gbs Mod a(i) <> 0 Then gbs = gbs + a(1): Exit For
Next i
Loop Until i = n + 1
Print gbs
求最大公倍数 的问题
Do
For i = 2 To n
If gbs Mod a(i) <> 0 Then gbs = gbs + a(1): Exit For
Next i
Loop Until i = n + 1
这个":EXIT FOR"和IF有没有关系啊..
还有 DO LOOP until i =n+1 这个 i 是怎么等于 n+1的?
n = InputBox("n=")
ReDim a(n) As Integer
For i = 1 To n
a(i) = InputBox("a(" + Str(i) + ")=")
Next i
gbs = a(1)
Do
For i = 2 To n
If gbs Mod a(i) <> 0 Then gbs = gbs + a(1): Exit For
Next i
Loop Until i = n + 1
Print gbs
求最大公倍数 的问题
Do
For i = 2 To n
If gbs Mod a(i) <> 0 Then gbs = gbs + a(1): Exit For
Next i
Loop Until i = n + 1
这个":EXIT FOR"和IF有没有关系啊..
还有 DO LOOP until i =n+1 这个 i 是怎么等于 n+1的?