places = gets.to_s.chomp!.split('') number_of_rats = places.size.to_f number_of_correct_answers = places.select { |p| p if p == 'o' }.size.to_f places.each do |place| puts sprintf('%.13f', number_of_correct_answers / number_of_rats * 100) number_of_correct_answers -= 1 if place == 'o' number_of_rats -= 1 end