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 |a| if a == 'o' puts sprintf('%.13f', number_of_correct_answers / number_of_rats * 100) number_of_correct_answers -= 1 else puts sprintf('%.13f', number_of_correct_answers / number_of_rats * 100) end number_of_rats -= 1 end