早睡早起,方能养生
Sleep early rise early, way to keep healthy

辗转相除法求最大公约数

super
2021-08-26 18:10
views 2494

$a = 417;
$b = 396;

while ($b != 0) {
    $c = $a % $b;
    
    $a = $b;
    $b = $c;
}
print_r($a);

 

 

在线运行

 



分享
0 条讨论
top