python解一次不定方程linear Diophantus Equation
python解一次不定方程linear Diophantus Equation话不多说,上代码:def gcd(a,b): #最大公约 r=a%b if r==0: return b else: return gcd(b,r)def LDE(a,b):#先求a‘x+b’y=1 (a',b')=1 if b==1: return 0,1 x2, y2 = LDE(b, a % b) x = y2 y
原创
2021-07-14 19:24:50 ·
414 阅读 ·
0 评论