组卷题库 > 高中信息技术试卷库
试题详情
有如下VB程序段:

Function GCD(m As Long, n As Long) As Long

 Dim temp As Long, r As Long

 If m < n Then temp = m: m = n: n = temp

 d = m - n

 Do While d <> n

  If d >= n Then

    m = d

  Else

    m = n

    n = d

  End If

  d = m - n

 Loop

 GCD = n

End Function

Private Sub Command1_Click()

  Text1.Text = Str(GCD(48,36))

End Sub

程序运行完后,单击Command1按钮,文本框Text1中显示的是 (  )

A、12
B、18
C、36
D、48
知识点
参考答案
采纳过本试题的试卷
    教育网站链接