# HG changeset patch # User FUJIKAWA Kosuke # Date 1391686757 -32400 # Node ID 414b74d71cdb617e8bc6bd4139bb129ef65a237a # Parent 72baa7d277d80ccb1fe7a95de001d5acc9ca02b6 cgitest diff -r 72baa7d277d8 -r 414b74d71cdb nakamachi/hoge.dat --- a/nakamachi/hoge.dat Thu Feb 06 20:32:53 2014 +0900 +++ b/nakamachi/hoge.dat Thu Feb 06 20:39:17 2014 +0900 @@ -1,5 +1,5 @@ -1 106996 4 ¤Õ¤¸ -2 1165563 3 ¤«¤ï +1 106996 0 a +2 1165563 0 a 3 1547608 0 a 4 1637816 0 a 5 1674821 0 a diff -r 72baa7d277d8 -r 414b74d71cdb nakamachi/plas.rb --- a/nakamachi/plas.rb Thu Feb 06 20:32:53 2014 +0900 +++ b/nakamachi/plas.rb Thu Feb 06 20:39:17 2014 +0900 @@ -9,6 +9,17 @@ math1 = cgi["math1"].to_i math2 = cgi["math2"].to_i +open("hoge.dat","r") do |hoge| + while line = hoge.gets + line = line.toeuc + if /(\d+)\s+(\d+)\s+(\d+)\s+(\S+)/ =~ line + ban[n] = $1.to_i + data[$1.to_i] = $2.to_i,$3.to_i,$4 + n += 1 + end + end +end + printf(<<_EOS_,math1,math2,math1+math2)