算法原理 Python代码 def myExtGCD(a, b): """ a: 模的取值 b: 想求逆的值 """ if (b == 0): return 1, 0, a x, y, gcd = myExtGCD(b, a % b) return y, x-a//b*y, gcd print(myExtGCD(71, 7)[1] % 71) 参考文献 https://blog.csdn.net/zhjchengfeng5/article/details/7786595 来源:https://www.cnblogs.com/kexve/p/11642861.html 标签 欧几里得 python