填空题

标准模块和窗体模块的功能是计算和打印两个复数之和,在横线上填上适当内容。标准模块
Type comp
re As Single
im As Single
End Type
Public c As comp
窗体模块
Private Sub Command1_Click( )
Dim a As comp,b As comp
  • a.re=InputBox(“输入a的实部”)a.im=InputBox(“输入a的虚部”)
  • b.re=tnputBox(“输入b的实部”)b.im=lnputBox(“输入b的虚部”)
    【6】
    Print“c=”;
  • c.re;“+”;c.im;"i"
    End Sub
    Private Sub s( 【7】 )
    C.re=r1.re+r2.re
    c.im=r1.im+r2.im
    End Sub

【参考答案】

[6]Call s(a,b)或 s a,b
[7] rl As comp,r2 As comp或ByRef ......

(↓↓↓ 点击下方‘点击查看答案’看完整答案、解析 ↓↓↓)