当前位置:网站首页>Use the rolling division method to find the maximum common divisor of two numbers

Use the rolling division method to find the maximum common divisor of two numbers

2022-04-23 20:13:00 Jiugui wine!!!

First use the largest number divided by the smallest number

If :

The result is equal to the 0, Then the largest common divisor is the smallest number

The result is not equal to 0, Now the largest number is the smallest number before , Now the smallest number is the remainder . Continue to divide until the result is equal to 0.

One 、 Suppose two numbers are 24、16

solution :24/16=0, Then the smallest number 16 Is the greatest common divisor .

Two 、 Suppose two numbers are 54、36

54/36=1 remainder 18

Now the maximum is 36, The smallest is 18

36/18=0, Then the minimum number 18 Is the greatest common divisor .

x.remainder(y) It's the remainder

版权声明
本文为[Jiugui wine!!!]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210556007024.html

随机推荐