|
|
вернуться в форумwhat's wrong? Ruby help. thanks a = gets b = [] c = [] b = a.split(/\n/) b.each { |x| y = x.lstrip.rstrip.split[0].to_f y = Math.sqrt(y) c << "%.4f" % y } puts c.reverse.join("\n") seems to return the right values. am i messing up with the .split[0]? any help would be appreciated. thanks! |
|
|