Untitled
By: a guest | Mar 20th, 2010 | Syntax:
Ruby | Size: 0.22 KB | Hits: 61 | Expires: Never
#by vi002
peoples, traffic = 0, 0
while line = gets do
case line.strip
when /\+\w+/ then peoples += 1
when /\-\w+/ then peoples -= 1
when /\w+:(.+)/ then traffic += peoples * $1.size
end
end
puts traffic