1
0
Fork 0
cp-templates/number/gcd.rs

6 lines
98 B
Rust

let gcd = |mut x: i64, mut y: i64|{
while y != 0 {
(x, y) = (y, x % y);
}
x
};