vb程序求和:1+1+2+1+2+3+1+2+3+4+……+1+2+……+100
3个回答
展开全部
Private Sub Command1_Click()
Dim i As Integer, j As Integer, sum As Long
For i = 1 To 100
For j = 1 To i
sum = sum + j
Next
Next
Print sum
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
dim s as long
dim n as integer
dim i as integer
s=0
n=1
do until n>100
for i=1 to n
s=s+i
next i
n=n+1
loop
print s
dim n as integer
dim i as integer
s=0
n=1
do until n>100
for i=1 to n
s=s+i
next i
n=n+1
loop
print s
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
dim sum as Integer
for i=1 to 100
for j=1 to i
sum=sum+j
next
next
for i=1 to 100
for j=1 to i
sum=sum+j
next
next
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询