📜  最大公约数迭代 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:39.535000             🧑  作者: Mango

代码示例2
fn gcd(mut m: i32, mut n: i32) -> i32 {
   while m != 0 {
       let old_m = m;
       m = n % m;
       n = old_m;
   }
   n.abs()
}

fn main() {
    println!("Greatest Common Divisor = {} ",gcd(115, 230));
}