| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 901 人关注过本帖
标题:转置矩阵问题(续)
只看楼主 加入收藏
xiaolaba3330
Rank: 1
来 自:辽宁大连
等 级:新手上路
帖 子:175
专家分:0
注 册:2007-10-19
结帖率:100%
收藏
 问题点数:0 回复次数:9 
转置矩阵问题(续)
Dim a(1 To 8, 1 To 8) As Integer, b(1 To 8, 1 To 8) As Integer

Private Sub Command1_Click()
For i = 1 To 8
 For j = 1 To 8
b(j, i) = GetArray(i, j)
Next
Next
Picture1.CurrentY = 80
For i = 1 To 8
 For j = 1 To 8
 Picture1.Print Format(b(i, j), "@@@");
 Next
 Picture1.Print
 Picture1.Print
 Next
End Sub

Private Sub Command2_Click()
Picture1.Cls
Form_Activate
End Sub

Private Sub Form_Activate()
 Form_Load
End Sub

Private Sub Form_Load()
Randomize
For i = 1 To 8
 For j = 1 To 8
 a(i, j) = Int(Rnd * 90) + 10
Next
Next
Picture1.CurrentY = 80
For i = 1 To 8
 For j = 1 To 8
 Picture1.Print Format(a(i, j), "@@@");
 Next
 Picture1.Print
 Picture1.Print
 Next
End Sub

Function GetArray(i As Integer, j As Integer) As Integer
 GetArray = a(i, j)
End Function

原帖地址:https://bbs.bccn.net/thread-209316-1-1.html

还是报错,麻烦再帮我看一下哦!!!

[[it] 本帖最后由 xiaolaba3330 于 2008-4-16 12:54 编辑 [/it]]
搜索更多相关主题的帖子: 矩阵 
2008-04-16 12:52
xiaolaba3330
Rank: 1
来 自:辽宁大连
等 级:新手上路
帖 子:175
专家分:0
注 册:2007-10-19
收藏
得分:0 
自己顶上来,麻烦大家帮忙看看!!

编程学习中~~
2008-04-16 21:40
清澂居士
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:1237
专家分:7
注 册:2006-12-19
收藏
得分:0 
不知道做什么用的?
用D3D的时候才开始学矩阵。。。现在还糊涂呢。

佛曰:\"前世的500次回眸才换来今生的一次擦肩而过\".我宁愿用来世的一次擦肩而过来换得今生的500次回眸.
2008-04-16 23:33
xiaolaba3330
Rank: 1
来 自:辽宁大连
等 级:新手上路
帖 子:175
专家分:0
注 册:2007-10-19
收藏
得分:0 
自己再顶一个,嘿嘿~~~~~~~

编程学习中~~
2008-04-17 12:01
永夜的极光
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2721
专家分:1
注 册:2007-10-9
收藏
得分:0 
那一句报错,报什么错,你要说明啊,不然怎么帮你看

从BFS(Breadth First Study)到DFS(Depth First Study)
2008-04-17 13:29
xiaolaba3330
Rank: 1
来 自:辽宁大连
等 级:新手上路
帖 子:175
专家分:0
注 册:2007-10-19
收藏
得分:0 
Private Sub Command1_Click()
For i = 1 To 8
For j = 1 To 8
b(j, i) = GetArray(i, j)
这句报错,说byref参数类型不符合

编程学习中~~
2008-04-17 13:33
zougonghua
Rank: 1
等 级:新手上路
帖 子:163
专家分:0
注 册:2008-4-1
收藏
得分:0 
Dim a(1 To 8, 1 To 8) As Integer, b(1 To 8, 1 To 8) As Integer
Dim i, j As Integer

Private Sub Command1_Click()
For i = 1 To 8
    For j = 1 To 8
        b(j, i) = a(i, j)
    Next
Next
Picture2.CurrentY = 80
For i = 1 To 8
    For j = 1 To 8
        Picture2.Print Format(b(i, j), "@@@");
    Next
    Picture2.Print
    Picture2.Print
Next
End Sub

Private Sub Command2_Click()
Picture1.Cls
Form_Activate
End Sub

Private Sub Form_Activate()
Form_Load
End Sub

Private Sub Form_Load()
Randomize
For i = 1 To 8
    For j = 1 To 8
        a(i, j) = Int(Rnd * 90) + 10
    Next
Next
Picture1.CurrentY = 80
For i = 1 To 8
    For j = 1 To 8
        Picture1.Print Format(a(i, j), "@@@");
    Next
    Picture1.Print
    Picture1.Print
Next
End Sub
2008-04-17 15:04
xiaolaba3330
Rank: 1
来 自:辽宁大连
等 级:新手上路
帖 子:175
专家分:0
注 册:2007-10-19
收藏
得分:0 
怎么没有函数啊?

编程学习中~~
2008-04-17 15:07
zougonghua
Rank: 1
等 级:新手上路
帖 子:163
专家分:0
注 册:2008-4-1
收藏
得分:0 
回复 8# 的帖子
简单的可以不用,没必要写那么多..如果硬要的话可以写成
Dim a(1 To 8, 1 To 8) As Integer, b(1 To 8, 1 To 8) As Integer
Dim i, j As Integer

Private Sub Command1_Click()
'Picture1.Cls
For i = 1 To 8
    For j = 1 To 8
        Call GetArray(i, j)
    Next
Next
Picture2.CurrentY = 80
For i = 1 To 8
    For j = 1 To 8
        Picture2.Print Format(b(i, j), "@@@");
    Next
    Picture2.Print
    Picture2.Print
Next
End Sub

Private Sub Command2_Click()
Picture1.Cls
Form_Activate
End Sub

Private Sub Form_Activate()
Form_Load
End Sub

Private Sub Form_Load()
Randomize
For i = 1 To 8
    For j = 1 To 8
        a(i, j) = Int(Rnd * 90) + 10
    Next
Next
Picture1.CurrentY = 80
For i = 1 To 8
    For j = 1 To 8
        Picture1.Print Format(a(i, j), "@@@");
    Next
    Picture1.Print
    Picture1.Print
Next
End Sub

Function GetArray(i, j) As Integer
b(j, i) = a(i, j)
End Function
2008-04-17 15:13
xiaolaba3330
Rank: 1
来 自:辽宁大连
等 级:新手上路
帖 子:175
专家分:0
注 册:2007-10-19
收藏
得分:0 
3Q

就是想通过这段程序明白函数是如何返回二维数组的!!

编程学习中~~
2008-04-17 15:17
快速回复:转置矩阵问题(续)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.043405 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved