如果需要读入不定个数,那就在程序中再加一句输入n的语句,或添加一text1,其中内容表示元素个数。
private
sub
form_click()
dim
a(1
to
10000)
as
integer,n
as
integer
n
=
inputbox("请输入数组元素个数",
"输入框")
'
n=val(text1.text)
open
"e:\vbprogram\input\0.txt"
for
input
as
#1
for
i
=
1
to
n
input
#1,
a(i)
next
close
#1
for
i
=
1
to
n
print
a(i)
next
end
sub
温馨提示:答案为网友推荐,仅供参考