#!/usr/bin/ruby # -*- coding: utf-8 -*- =begin 단어 빈도수 계산 프로그램 =end words = "This is a test This is only a test".downcase.split(" ") result = Hash.new words.each { |w| result[w] = result[w]?result[w]+1:1} puts result