#!/usr/koeki/bin/ruby # coding: utf-8 pref = Hash.new while true STDERR.print "都道府県名: " tdfk = gets if tdfk == nil break end tdfk.chomp! STDERR.print "都道府県庁所在地: " ofc = gets.chomp! pref[tdfk] = ofc end STDERR.print "読込終了\n" p pref