这是一个问题。有人能找出答案吗?
最多允许两个“if”测试!
Given numbers from 1 to 100
If this number is divisble by 21 print "foobar"
If this number is divisble by 7 print "bar"
If this number is divisble by 3 print "foo"
If none of the above, print the number
只应打印一个数字。例如,数字 21 应该只打印“foobar”,而不是所有“foobar”、“bar”、“foo”。
可以用任何语言完成。
非常感谢。