分别使用VBScript的Do While…Loop 和Do Until …Loop语句编写计算11*11+12*12+13*13+…23*23
2个回答
展开全部
dim he,i
he = 0
i = 1
do until i > 1000
if i mod 7 <> 0 then
he = he + i
end if
i = i + 1
loop
msgbox he
'======================
dim he,i
he = 0
i = 1
for i = 1 to 1000
if i mod 7 <> 0 then
he = he + i
end if
next
msgbox he
'======================
dim he,i
he = 0
i = 1
while i <= 1000
if i mod 7 <> 0 then
he = he + i
end if
i = i + 1
wend
msgbox he
he = 0
i = 1
do until i > 1000
if i mod 7 <> 0 then
he = he + i
end if
i = i + 1
loop
msgbox he
'======================
dim he,i
he = 0
i = 1
for i = 1 to 1000
if i mod 7 <> 0 then
he = he + i
end if
next
msgbox he
'======================
dim he,i
he = 0
i = 1
while i <= 1000
if i mod 7 <> 0 then
he = he + i
end if
i = i + 1
wend
msgbox he
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询