fn main() {
let input_str = "2.809 -36.91 21.487 -493.808 5034.7001";
let mut floats: Vec<f32> = Vec::new();
for token in input_str.split_whitespace() {
if let Ok(f) = token.parse::<f32>() {
println!("{}", f);
floats.push(f);
}
}
println!("{:?}", floats);
}
/*
run:
2.809
-36.91
21.487
-493.808
5034.7
[2.809, -36.91, 21.487, -493.808, 5034.7]
*/