vb课后习题答案

2025-12-17 05:29:04
推荐回答(2个)
回答1:

dim a(15) as string
for i=0 to 15
a(i)=char(rnd*(90-65+1)+65)
for j=0 to i
if(a(j)=a(i)) then
i--
exit for
endif
next j
next i
这是第一个

dim x(10) as interage
for k=1 to 10
x(k)=k
print x(k); '交换前的打印
next k

for i=1 to 5
for j=10 to 5 step -1
x(i)=x(j)
next j
next i

for y=1 to 10 '交换后的
print y(k);
next y

回答2:

dim a(15) as string*1
for i=0 to 15
a(i)=chr(rnd*26+65)
for j=0 to i
if(a(j)=a(i)) then
i=i-1
exit for
endif
next j
next i