急求答案。那个好心高手帮帮忙。VB编写程序题。写出“输出1-50之间,能被3整除的数,并累加这些数的和”的 10
2个回答
展开全部
private sub command1_click()
dim sum as integer
dim i as integer
sum=0
for i = 1 to 50
if i mod 3 =0 then
msgbox i &"能被3整除",VbOkOnly+VbInformation,"提示"
sum=sum+i
end if
next i
msgbox "这些数的和为" & sum,VbOkOnly+VbInformation,"提示"
dim sum as integer
dim i as integer
sum=0
for i = 1 to 50
if i mod 3 =0 then
msgbox i &"能被3整除",VbOkOnly+VbInformation,"提示"
sum=sum+i
end if
next i
msgbox "这些数的和为" & sum,VbOkOnly+VbInformation,"提示"
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询