gcd(18,150)=
举一反三
- gcd(18,150)=( )。 A: 4 B: 9 C: 6 D: 8
- 使用欧几里得算法找到最大公约数的线性组合式(答案中不要有空格)。a) gcd(620, 140) = 20, 20 = ______ ´ 620 + ______ ´ 140.b) gcd(662, 414) = 2, 2 = ______ ´ 662 + ______ ´ 414.c) gcd(84, 18) = ______ ´ 18 + ______ ´ 84.d) gcd(450, 120) = ______ ´ 120 + ______ ´ 450.
- 下面是求最大公约数的函数gcd的首部 Function gcd(ByVal x As Integer, ByVal y As Integer) As Integer 若要输出8、12、16这3个数的最大公约数,下列语句中正确的是 A: Print gcd (8,12), gcd(12,6), gcd(16,8) B: Print gcd (8,12,16) C: Print gcd (8), gcd(12), gcd(16) D: Print gcd (8, gcd(12,16))
- 下列计算最大公约数的递归过程,正确的是___________。 A: Sub gcd(ByVal m%, ByVal n%) Dim r% r = m n If r = 0 Then gcd = n Else gcd = gcd(n, r) End If End Sub B: Sub gcd(ByVal m%, ByVal n%) Dim r% r = m Mod n If r = 0 Then gcd = n Else gcd = gcd(n, r) End If End Sub C: Function gcd%(ByVal m%, ByVal n%) Dim r% r = m n If r = 0 Then gcd = n Else gcd = gcd(n, r) End If End Function D: Function gcd%(ByVal m%, ByVal n%) Dim r% r = m Mod n If r = 0 Then gcd = n Else gcd = gcd(n, r) End If End Function
- GCD基于()语言,GCD任务取出遵循队列()原则。