use proconio::input; use proconio::marker::Chars; fn main(){ input!{ s: Chars, } let mut n = s.len(); let mut o = s.iter().filter(|&&x| x=='o').count(); for c in s{ println!("{}", (o as f64)/(n as f64)*100_f64); o -= if c == 'o'{1} else{0}; n -= 1; } }