以下程序段的功能是:从键盘输入一个值到文本框(txtnum),单击出题按钮(cmdct)根据这个值随机产生两个数放入两个文本框内(txt1和txt2),要求两个数相加之和不能超过输入值。在文本框(txt3)中输入答案,单击判断按钮(cmdpd)进行判断,并在标签(lblpj)中显示算式和评价信息。请完善程序。 Private Sub cmdct_Click() Dim x As Integer Dim y As Integer num = Val(txtnum.Text) Do x = Int(Rnd * num) y = Int(Rnd * num) Loop Until txt1.Text = x txt2.Text = y End Sub Private Sub cmdpd_Click() Dim x As Integer Dim y As Integer Dim z As Integer x = Val(txt1.Text) y = Val(txt2.Text) z = Val(txt3.Text) pj = If x + y = z Then lblpj.Caption = pj & " 回答正确!" Else lblpj.Caption = pj & " 回答错误!" End If End Sub