设计一个解二元一次方程组ax+by=c dx+ey=f的程序,用矩阵的思想解。写出的程序如下,就是解不对。请只错

[复制链接]
查看11 | 回复2 | 2011-3-9 22:02:09 | 显示全部楼层 |阅读模式
Private Sub Command1_Click()
Dim a As Single, b As Single, c As Single
Dim d As Single, e As Single, f As Single
Dim x As Single, y As Single
a = Text1.Text
b = Text2.Text
c = Text3.Text
d = Text4.Text
e = Text5.Text
f = Text6.Text
a = a / a
b = b / a
c = c / a
d = d / d
e = e / d
f = f / d
d = d - a
e = e - b
f = f - c
e = e / e
f = f / e
y = f
b = b - (e * b)
c = c - (f * b)
x = c
Label5.Caption = "x=" & x & "," & "y=" & y
End Sub
如果全盘否定,请写出你认为的程序

回复

使用道具 举报

千问 | 2011-3-9 22:02:09 | 显示全部楼层
你的代码有点错,倒数第二行sin(B)应该为sin(a)Private Sub Command1_Click()Dim B As Single 定义b为单精度数B = CSng(Text1.Text) 把text1里的内容改为单精度数MsgBox "指定角度的正弦值为:" & sin1(B) 输出结果End Sub以下为自定义函数Public Function sin1(a As Single)sin1 = Sin(a) 赋值语句,算出b的正弦值End Function关于连接问题:当执行到MsgBox "指定角度的正弦值为:" & sin1(B) 输出结果时,引用了自己定义的函数 sin1,
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行