Dim i As Integer,n As Integer For i = 0 To 50 i = i + 3 n =

Dim i As Integer,n As Integer For i = 0 To 50 i = i + 3 n = n + 1 If i > 10 Then Exit For Next Pri
Dim i As Integer,n As Integer
For i = 0 To 50
i = i + 3
n = n + 1
If i > 10 Then Exit For
Next
Print n
怎么算
等你来爱我1万年 1年前 已收到1个回答 举报

IndustryControl 幼苗

共回答了16个问题采纳率:87.5% 举报

实现效果,输出结果3
原理:
For i = 0 To 50
定义i从0循环到50
i = i + 3
这时i=0,所以其语句将原来的i值加上3
得3
n = n + 1
累加n
If i > 10 Then Exit For
判断i是否大于10,若是则跳出循环
第一次:
i=0
i=3
n=1
第二次:
i=3
i=6
n=2
第三次
i=6
i=9
n=3
第四次
i=9
i=12
i已大于10,跳出循环
输出n=3

1年前

5
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 1.498 s. - webmaster@yulucn.com