用VB 编写程序,计算1+2+3……+100的和。

2024-12-14 01:37:45
推荐回答(2个)
回答1:

private sub Form_Load()
dim i,s as integer
s=0
for i=1 to 100
s=s+i
next i
print s
end sub

回答2:

Dim i As Integer, sum As Integer
sum = 0
For i = 1 To 100
sum = sum + i
Next i
Print sum