vbs实现n*n二维数组大小值位置
1个回答
2016-03-01
展开全部
dim a(2,2)
dim i,j
dim maxi,maxj,mini,minj
dim max,min
randomize
for i=0 to ubound(2) step 1
for j=0 to ubound(2) step 1
if max<= a(i,j) then max=a(i,j) and maxj=j and maxi=i
if min >=a(i,j) then min=a(i,j) and mini=i and miinj=j
next j
next i
================
输出的部分我就省略了
dim i,j
dim maxi,maxj,mini,minj
dim max,min
randomize
for i=0 to ubound(2) step 1
for j=0 to ubound(2) step 1
if max<= a(i,j) then max=a(i,j) and maxj=j and maxi=i
if min >=a(i,j) then min=a(i,j) and mini=i and miinj=j
next j
next i
================
输出的部分我就省略了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询