for i = 0 to 3
在江都等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供成都网站设计、网站制作 网站设计制作按需定制制作,公司网站建设,企业网站建设,品牌网站建设,全网营销推广,外贸网站制作,江都网站建设费用合理。
textbox_未知.text = a(i,1) a(i,2) a(i,3) a(i,4) vbcrlf
next
如果我吧长宽弄反了自行转正,
如果要间隔,请插入 VBtab
VB源程序如下:
Option Base 1
Private Sub Command1_Click()
Dim A(5, 5) As Integer, B(5, 5) As Integer
For x = 1 To 5
For y = 1 To 5
A(x, y) = Int(10 + Rnd * 90) '随机产生两位数的整数
Print A(x, y); '输出
Next
Next
For x = 1 To 5
For y = 1 To 5
B(x, y) = A(y, x) '转置
Print B(x, y); '输出
Next
Next
End Sub
程序输出结果如下:
扩展资料:
VB:编写程序,实现如下规律的5*5矩阵存入数组,并输出该数组
Private Sub Command1_Click()
Dim a(1 To 6, 1 To 6) As Integer
For i = 1 To 5
For j = 1 To 5
tmp = 99
If i tmp Then
tmp = i
End If
If j tmp Then
tmp = j
End If
If 6 - i tmp Then
tmp = 6 - i
End If
If 6 - j tmp Then
tmp = 6 - j
End If
a(i, j) = tmp
Next j
Next i
For i = 1 To 5
For j = 1 To 5
Picture1.Print Tab(j * 5); a(i, j);
Next j
Picture1.Print
Next i
End Sub
程序输出结果如下:
Private Sub Command1_Click()
Dim a(1 To 3, 1 To 5) As Integer, b(1 To 5, 1 To 3) As Integer
Cls
Print "产生的A数组:"
For i = 1 To 3
For j = 1 To 5
a(i, j) = Int(Rnd * 100)
Print a(i, j);
Next j
Next i
zhuanzhi a, b
Print "转置后的B数组:"
For i = 1 To 5
For j = 1 To 3
Print b(i, j);
Next j
Next i
End Sub
Sub zhuanzhi(ByRef a() As Integer, ByRef b() As Integer)
For i = LBound(a, 1) To UBound(a, 1)
For j = LBound(a, 2) To UBound(a, 2)
b(j, i) = a(i, j)
Next j
Next i
End Sub
分享文章:vb点虐
二维数组转置 vb6 二维数组
当前地址:https://www.cdcxhl.com/article42/ddeocec.html
成都网站建设公司_创新互联,为您提供定制开发、动态网站、、面包屑导航、响应式网站、品牌网站制作
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联