展开全部
dim arr(1 to 20) as integer , i as integer,sum as integer
private sub command1_click()
sum = 0
randomize
for i = 1 to 20
arr(i) = int(rnd*21)+30
sum = sum + arr(i)
print arr(i);
if i mod 10=0 then print
next
end sub
private sub command2_click()
print "平均值是:" ; sum/20
end sub
private sub command1_click()
sum = 0
randomize
for i = 1 to 20
arr(i) = int(rnd*21)+30
sum = sum + arr(i)
print arr(i);
if i mod 10=0 then print
next
end sub
private sub command2_click()
print "平均值是:" ; sum/20
end sub
展开全部
dim a(20)
private sub command1_click()
randomize
for i=1 to 20
a(i)=int(rnd*21)+30
print a(i);
next
print
end sub
private sub command2_click()
for i=1 to 20
s=s+a(i)
next
print "平均值=";s/20
end sub
private sub command1_click()
randomize
for i=1 to 20
a(i)=int(rnd*21)+30
print a(i);
next
end sub
private sub command2_click()
for i=1 to 20
s=s+a(i)
next
print "平均值=";s/20
end sub
追问
,,,补充一下,漏了一句话。。产生的20个随机数是存在数组arr中以每行10个数显示 在窗体上
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询