struct Solution{
}
impl Solution {
fn new() -> Self {
Solution{}
}
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
* 求出a、b的最大公约数。
* @param a int整型
* @param b int整型
* @return int整型
*/
pub fn gcd(&self, a: i32, b: i32) -> i32 {
if a % b == 0 {
return b;
}
return Solution::gcd(self, b, a%b);
}
}

京公网安备 11010502036488号