回 帖 发 新 帖 刷新版面

主题:数组不懂

[em45]我自学到了数组,不太了解数组的运用,请告诉我运用方法.

回复列表 (共1个回复)

沙发

假设某班有 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

我来回复

您尚未登录,请登录后再回复。点此登录或注册