A-A+

有以下函数过程: Function Gys (ByVal x As Integer ByV

2022-08-06 04:25:27 问答库 阅读 175 次

问题详情

有以下函数过程: Function Gys (ByVal x As Integer, ByVal y As Integer) As Integer Do While y<>0 Reminder = x Mod y x = y y= Reminder Loop Gys=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a = 50 b = 10 x=Gys (a,B)Print x End Sub
A.0
B.10
C.50
D.100请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:B
解析:本首先要读懂Gys函数过程的意思,Gys函数过程返回参数y的值,具体过程是先令参数x的值为y的值,y的值为xMody的值,再令Gys值为x的值,据此本题的正确结果为10,选B。

考点:函数,过程