> 数学 >
VB编写程序题.写出“输出1-50之间,能被3整除的数,并累加这些数的和”的
人气:266 ℃ 时间:2019-08-23 06:50:27
解答
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
msgboxi &"能被3整除",VbOkOnly+VbInformation,"提示"
sum=sum+i
end if
next i
msgbox"这些数的和为" & sum,VbOkOnly+VbInformation,"提示"
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版