2011-12-29 35 views

回答

3

这应该是:

puts "hello" unless a and b 

或者

unless a and b 
    puts "hello" 
end 
0

由于unlessif否定,你需要来否定整个条件表达式(可以使用De Morgan’s laws简化它):

!(!a or !b) ≡ !!a and !!b ≡ a and b 

所以:

unless a or b 
    puts "hello world" 
end