📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "复数(Complex Number)的四则运算"
ClientHeight = 2988
ClientLeft = 2124
ClientTop = 1992
ClientWidth = 4596
LinkTopic = "Form1"
ScaleHeight = 2988
ScaleWidth = 4596
WindowState = 2 '最大化
Begin VB.CommandButton Command2
Caption = "三复数的运算"
Height = 564
Left = 1272
TabIndex = 1
Top = 1968
Width = 1956
End
Begin VB.CommandButton Command1
Caption = "两复数的运算"
Height = 564
Left = 1248
TabIndex = 0
Top = 1272
Width = 1956
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "执行结果请参考即时运算视窗"
Height = 180
Left = 1080
TabIndex = 2
Top = 408
Width = 2340
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim x As Complex, y As Complex, a As Complex, s As Complex
Dim m As Complex, d As Complex, sq As Complex, mo As Double
x.r = 3: x.i = 4
y.r = 8: y.i = -6
a = Add(x, y)
s = Subtract(x, y)
m = Multiply(x, y)
d = Divide(x, y)
sq = Square(x)
mo = Modulus(x)
Debug.Print a.r & " + " & a.i & "i"
Debug.Print s.r & " + " & s.i & "i"
Debug.Print m.r & " + " & m.i & "i"
Debug.Print d.r & " + " & d.i & "i"
Debug.Print sq.r & " + " & sq.i & "i"
Debug.Print mo
End Sub
Private Sub Command2_Click()
Dim a As Complex, x As Complex, y As Complex, z As Complex
x.r = 3: x.i = 4
y.r = 8: y.i = -6
z.r = 2: z.i = 5
a = Subtract(Add(x, y), z)
Debug.Print a.r & " + " & a.i & "i"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -