Skip to content · ⁨본문 바로가기⁩

FizzBuzz with 4 and 6 · ⁨4와 6을 사용한FizzBuzz⁩

English

FizzBuzz with 4 and 6

A FizzBuzz with a trap in it.

Test for both first, with n % 4 == 0 and n % 6 == 0. Multiplying the two numbers, n % 24 == 0, looks like a shortcut but misses 12: a number can divide by 4 and by 6 without dividing by 24.

한국어

4와 6을 사용한FizzBuzz

함정이 있는 FizzBuzz입니다.

먼저 n % 4 == 0 and n % 6 == 0으로 두 가지 조건 모두를 테스트하십시오. 두 수를 곱한 n % 24 == 0은捷径(shortcut)처럼 보이지만 12을 놓칩니다: 어떤 수는 4와 6으로 나누어지는 데도 24로 나누어지지 않을 수 있습니다.

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP