?:操作符 def how_many_messages(n) "You have " +n.to_s +(n==1 ? " message.":" messages. ") end 2011-4-19 13:30 danny