vb基本问题快来看看

2024-11-01 14:20:17
推荐回答(2个)
回答1:

dim a(1,1),b,i,j ,k as integer
a(0,0)=0
a(0,1)=1
a(1,0)=2
a(1,1)=3
b=inputbox("输入查询数字")
k=0
for i=0 to 1
for j=0 to 1
if b=a(i,j) then
k=1
msgbox(a(i,j))
end if
next
next
if k=0 then msgbox "没找到!"

回答2:

加个标志位
dim a(1,1),b,i,j ,jg
a(0,0)=0
a(0,1)=1
a(1,0)=2
a(1,1)=3
b=inputbox("输入查询数字")
for i=0 to 1
for j=0 to 1
if b=a(i,j) then
msgbox(a(i,j))
jg=1
end if
next
next
if jg<>1 then magbox("没找到")