主题:数组不懂
lsqhuman
[专家分:0] 发布于 2005-05-14 15:30:00
[em45]我自学到了数组,不太了解数组的运用,请告诉我运用方法.
回复列表 (共1个回复)
沙发
wuruxiang [专家分:60] 发布于 2005-05-14 19:06:00
假设某班有 2 个小组,每个小组 2 人。你可以这样做。
dim a$(2 , 2)
a(1 , 1) = " 张三,30岁,男 "
a(1 , 2) = " 李四,30岁,男 "
a(2 , 1) = " 小王,30岁,男 "
a(2 , 2) = " 小吴,30岁,男 "
first:print "你要找的人在几组?"
input b
if b > 2 and b < 0 then
print "没有这个组"
goto first
end if
second:print "你要找的人组号是?"
input c
if c > 2 and c < 0 then
print "没有这个组"
goto second
end if
print a(b , c)
end
我来回复