ここで質問です。誰かが答えを理解できますか?
最大 2 つの「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
1 つの番号のみを印刷する必要があります。たとえば、番号 21 は、すべての "foobar"、"bar"、"foo" ではなく、"foobar" のみを出力する必要があります。
どの言語でもできます。
どうもありがとう。