显示所有100以内6的倍数,并求这些数的和 用VB写出程序
3个回答
展开全部
dim a as double
private sub Form_Load()
for i=1 to 100
if i mod 6=0 then
a=a+i
end if
next i
msgbox a
unload me
end sub
运行结果为816
private sub Form_Load()
for i=1 to 100
if i mod 6=0 then
a=a+i
end if
next i
msgbox a
unload me
end sub
运行结果为816
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
private
sub
form_load()
dim
i
as
integer
dim
sum
as
integer
sum
=
0
for
i
= 6
to 100
step
6
sum
=
sum
+
i
next
msgbox
sum
end
sub
sub
form_load()
dim
i
as
integer
dim
sum
as
integer
sum
=
0
for
i
= 6
to 100
step
6
sum
=
sum
+
i
next
msgbox
sum
end
sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |