vb中判断语句 If A(i,j) =0 Then A(i,j)=k,其中动态数组A()被赋值为0,option base1dim A() as integerprivate sub command1_click()dim i as integer ,j as integer ,k as integerdim n as integern=3redim A(n,n)i=1:j=(n+1)/2k=1A(i,j)=k ________
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/20 03:44:05
vb中判断语句 If A(i,j) =0 Then A(i,j)=k,其中动态数组A()被赋值为0,option base1dim A() as integerprivate sub command1_click()dim i as integer ,j as integer ,k as integerdim n as integern=3redim A(n,n)i=1:j=(n+1)/2k=1A(i,j)=k ________
vb中判断语句 If A(i,j) =0 Then A(i,j)=k,其中动态数组A()被赋值为0,
option base1
dim A() as integer
private sub command1_click()
dim i as integer ,j as integer ,k as integer
dim n as integer
n=3
redim A(n,n)
i=1:j=(n+1)/2
k=1
A(i,j)=k __________这边是A(1,2)=1
for k=2 to 9 __________K=2
i=i-1 ___________i=1-1=0
j=j+1 ___________j=2+1=3
if i3 then ______不满足
i=i+2
j=j-1
else
if i3 then j=1
end if ———————至此 可知i=3 ,j=3
if A(i,j)=0 then
A(i,j)=k _____就是这里 是为什么
else ——标准答案是 A(3,3)=2
i=i+2
j=j-1
A(i,j)=k
end if
next
for i=1 to 3
for j = 1 to 3
print A(i,j)
next
print
next
end sub
vb中判断语句 If A(i,j) =0 Then A(i,j)=k,其中动态数组A()被赋值为0,option base1dim A() as integerprivate sub command1_click()dim i as integer ,j as integer ,k as integerdim n as integern=3redim A(n,n)i=1:j=(n+1)/2k=1A(i,j)=k ________
if ... then 间的是逻辑表达式,不是赋值表达式.
c语言:if(a(i,j)==0) ...
vb6 :if a(i,j)=0 then ...
If A(i,j) =0 Then A(i,j)=k这句的意思是如果A(i,j) =0 ,那么给A(i,j)赋值K