end sub23 1
程序运行后,单击command1,输出结果为: 32 3
4. 在窗体上画一个命令按钮command1,然后编写如下事件过程:
option base 1
private sub command1_click()
dim a%(10),p(3) as integer
k=5
for i=1 to 10
a(i)=i
for i=1 to 3
p(i)=a(i*i)
next i
for i=1 to 3
k=k+p(i)*2
next i
print k
end sub
程序运行后,单击command1,输出结果为:33
5. 在窗体上画一个命令按钮command1,然后编写如下事件过程:
option base 1
private sub command1_click()
dim a%(4,4)
for i=1 to 4
for j=1 to 4
a(i,j)=(i-1)*3+j
next j
next i
for i=1 to 4
for j=1 to 4
print a(j,i);
next j
print1 4 7 10
next I2 5 8 11
end sub3 6 9 12
程序运行后,单击command1,输出结果为:4 7 10 13
6. 在窗体上画一个命令按钮command1,然后编写如下事件过程:
option base 1
private sub command1_click()
dim a%(5,5)
for i=1 to 3
for j=1 to 4
if j>1 and i>1 then
a(i,j)=i*j
end if
next j
next i
for n=1 to 2
for m=1 to 3
print a(m,n);
next m
next n
end sub0 0 0
程序运行后,单击command1,输出结果为:0 4 6
7. 在窗体上画一个命令按钮command1,然后编写如下事件过程:
private sub command1_click()
dim a%(5)
for i=0 to 4
a(i)=i+1
t=i+1
if t=3 then
print a(i);
a(t-1)=a(i-2)
else
a(t)=a(i)
endif
if i=3 then a(i+1)=a(t-4)
a(4)=1
print a(i);
next i
end sub
程序运行后,单击command1,输出结果为:1 2 3 1 4 1
8. 在窗体上画一个命令按钮command1,然后编写如下事件过程:
private sub command1_click()
dim a%(3,3)
dim b
b=array(1,2,3,4,5,6,7,8,9)
j=1
for i=0 to 8
j=i mod 3
k=i\3
a(j,k)=b(i)
next i
k=1
for j=0 to 2
print tab(3*(j+1));a(k,j);
next j
end sub
程序运行后,单击command1,输出结果为:2 5 8
9. 在窗体上画一个命令按钮command1,一个文本框text1,然后编写如下事件过程: private sub command1_click()
dim b
b=array(34,5,13,35,9,6,42)
for i=1 to ubound(b,1)
if b(i)>b(i-1) then
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-22730-13.html
演员杨洋加油
还没到就直接误击沉吧