saws #5074(2007/12/31 10:18 GMT) [ Ruby ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9
OPRS = ['\+', '\-', '\*'] EQN = "1 - 4 * 5".split(/([#{OPRS.join}])/) N = 5 # result = EQN[0] (EQN.size - 1).div(2).times{|i| result = (eval "#{result}#{EQN[2*i+1]}#{EQN[2*i+2]}").modulo(N) } p "#{EQN}: #{result}"
Rating0/0=0.00-0+
[ reply ]
saws
#5074()
[
Ruby
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]