窗体上有两个文本框TextBox1和TextBox2,一个命令按钮Button1,编写下列程序:
DimyAsIntegerPrivateSubButton1_Click(···)HandlesButton1.ClickDimxAsInteger=2TextBox1....
Dim y As Integer
Private Sub Button1_Click(···) Handles Button1.Click
Dim x As Integer = 2
TextBox1.Text = p2(p1(x), y)
TextBox2.Text = p1(x)
End Sub
Private Function p1(x As Integer) As Integer
x = x + y
y = x + y
p1 = x + y
End Function
Private Function p2(x As Integer, y As Integer) As Integer
p2 = 2 * x + y
End Function
运行程序时,单击按钮后,文本框TextBox1和TextBox2中显示的信息是
A:2 4 B:10 10 C:8 4 D:4 4
ABCD哪个是正确答案呢? 展开
Private Sub Button1_Click(···) Handles Button1.Click
Dim x As Integer = 2
TextBox1.Text = p2(p1(x), y)
TextBox2.Text = p1(x)
End Sub
Private Function p1(x As Integer) As Integer
x = x + y
y = x + y
p1 = x + y
End Function
Private Function p2(x As Integer, y As Integer) As Integer
p2 = 2 * x + y
End Function
运行程序时,单击按钮后,文本框TextBox1和TextBox2中显示的信息是
A:2 4 B:10 10 C:8 4 D:4 4
ABCD哪个是正确答案呢? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询