面试题答案
一键面试fn divide(a: i32, b: i32) -> Result<i32, &'static str> {
if b == 0 {
Err("除数不能为零")
} else {
Ok(a / b)
}
}
fn divide(a: i32, b: i32) -> Result<i32, &'static str> {
if b == 0 {
Err("除数不能为零")
} else {
Ok(a / b)
}
}