VB题练习题,麻烦各位大神帮帮忙

2024-11-24 12:49:25
推荐回答(2个)
回答1:

8. 下面程序运行后的结果是(4)
a=Array(1,2,3,4,5)
print a(a(2))
11. 下面程序有错的一行(redim a%(1 to 4),i%)
redim a%(1 to 4),i%
for i=1 to 4 step 1.6 '第A行
a(i)=2*i ’第B行
next i ‘第C行
if a(2) then print a(2) '第D行
14. 下面程序运行后的输出结果是()
dim a(3,3),i%,j%
for i=1 to 3
for j=1 to 3
if i+j=4 or i=j then a(i,j)=0 else a(i,j)=1
print a(i,j);
next j
print
next i
0 1 0
1 0 1
0 1 0
16. 下面程序运行后的结果(105)
dim a,f%,i%
a=Array(1,"3","5",7)
f=1
for i=LBound(a) to UBound(a)
f=f*a(i)
next i
print f
17. 下面程序的功能是将一维数组中的6个数逆序存放并输出。完成填空。
dim a, i%,j%,t%
a=array(1,2,3,4,5,6)
i=0:j=5
Do While(_)
t=a(_)
a(_)=a(_)
a(_)=(_)
i=i+1
(_)
loop
for i=0 to 5
print a(i);
next i
Dim a, i%, j%, t%
a = Array(1, 2, 3, 4, 5, 6)
i = 0: j = 5
Do While (i < 3)
t = a(i)
a(i) = a(j)
a(j) = t
i = i + 1
j = j - 1
Loop
For i = 0 To 5
Print a(i);
Next i

回答2:

1 对 没有余数即是整除
2 对
3 错