vb 5*5矩阵 对角线上元素之积 。急


dim i,j,temp
dim arr(1 To 5, 1 To 5)
''....初始化咐正谨数组...''''
temp = 1
for i = 1 to 5
for j = 1 to 5
if i = j then
temp = temp * arr(i,j)
next j
next i
print "对角线之积为:清枣"衡基 & temp
dim a(4,4) as integer,i as integer,,j as integer,s as long
for i=0 to 4
for j=0 to 4
randomize
a(i,j)=int(rnd*100)
print a(i,j);
next j
print
next i
s=1
for i=0 to 4
s=s*a(i,i)
next i
print "对角线积:"; s