vb 编写一个矩阵,建立并输出一个10*10的矩阵,该矩阵对角线元素为1,其余元素均为0 20
1个回答
展开全部
private sub command_click()
dim a(10,10)
for i=1 to 10
for j=1 to 10
a(i,j)=0
next j,i
for i=1 to 10
a(i,i)=1
a(i,11-i)=1
next i
for i=1 to 10
for j=1 to 10
print a(i,j);
next j
print
next i
end sub
dim a(10,10)
for i=1 to 10
for j=1 to 10
a(i,j)=0
next j,i
for i=1 to 10
a(i,i)=1
a(i,11-i)=1
next i
for i=1 to 10
for j=1 to 10
print a(i,j);
next j
next i
end sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询