fn s(a:f64,b:i32) -> f64 {
let mut th1 = 1.0;
let mut th2 = 0.0;
let mut th3 = 0.0;
let mut k = 0;
while k < b{
while th3 * th3 < a{
th2 = th3;
th3 = th3 + th1;
}
th3 = th2;
th1 = th1 * 0.1;
k += 1;
}
th3
}
fn main() {
println!("結果:{}",s(2.0,10));
}
To embed this project on your website, copy the following code and paste it into your website's HTML: