0
正確的輸出我有像這樣的哈希...如何從哈希
scores = {:b3=>1000, :c3=>-1000}
scores.each do |k,v|
if v = 1000
best_answer = k
elsif v = -1000
best_answer = k
end
end
p 'BEST_ANSWER'
p best_answer
return best_answer
我不斷收到C3
best_answer應該是B3
我究竟做錯了什麼?
嗯,這似乎是正確的,但我仍然得到c3作爲輸出:( – thefonso
你想念回報,秒,更新答案 – 2012-12-01 00:10:17