用vb计算1至200内所有能被3整除的奇数之和

来源:百度知道 编辑:UC知道 时间:2024/05/22 10:31:25
用vb计算1至200内所有能被3整除的奇数之和
不对啊 要是3以内的话就不对

楼上错误

for i=1 to 200
if i mod 2 =1 and i mod 3=0 then s = s + i
next i
print s

for i=1 to 200
if i mod 2=1 and i mod 3=0 then i=i+1
next i
print i

被发现了诶。。。郁闷啊~!

dim a as integer
a=0
for i=1 to 200
if i mod 2=1 and i mod 3=0 then
a=a+i
end if
next
print a