// Programme test2.rs // rustc -A warnings test2.rs -o test2rs; ./test2rs use std::io; use std::io::Write; fn main() { let b: u16 = 1; loop { print!("Borne:? "); io::stdout().flush().unwrap(); let mut input = String::new(); io::stdin().read_line(&mut input); let b: u16 = input.trim().parse().expect(""); if b == 0 { break; } else { let mut i: u16 = 1; loop { let c = u16::pow(i,2); let r = f32::sqrt(i as f32); println!("I= {} I^2= {} I^1/2= {}",i,c,r); i += 1; if i > b { break; } } } } println!("Fin du programme test2.rs"); }