| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 410 人关注过本帖
标题:[求助]我错在哪里了?
取消只看楼主 加入收藏
四环素牙
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-11-19
收藏
 问题点数:0 回复次数:0 
[求助]我错在哪里了?
Function det(a() As Single) As Single
Dim n, i, p, q As Integer
ReDim a(1 To n, 1 To n)
For i = 1 To n
If n = 2 Then
det = a(1, 1) * a(2, 2) - a(1, 2) * a(2, 1)
ElseIf n > 2 Then
ReDim b(1 To n - 1, 1 To n - 1) As Single
Dim p, q As Integer
If i = 1 Then
For p = 1 To n - 1
For q = 1 To n - 1
b(p, q) = a(p + 1, q)
Next q
Next p
ElseIf i = n Then
For p = 1 To n - 1
For q = 1 To n - 1
b(p, q) = a(p, q)
Next q
Next p
Else
For p = 1 To i - 1
For q = 1 To n - 1
b(p, q) = a(p, q)
Next q
Next p
For p = i + 1 To n
For q = 1 To n - 1
b(p - 1, q) = a(p, q)
Next q
Next p
End If
If i + n Mod 2 = 0 Then
det = det + det(b()) * a(i, n)
Else
det = det - det(b()) * a(i, n)
End If
End If
Next i
End Function
2006-11-22 14:53
快速回复:[求助]我错在哪里了?
数据加载中...
 
   



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

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