def count_word( input )
words = Hash.new(0)
input_words = input.split(' ')
input_words.each do |word|
words[word] += 1
end
words
end
input = gets
p count_word(input)
Created
March 30, 2014 21:32
-
-
Save t-oginogin/9880207 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment