Domanda di colloquio di MedMen

Fizz buzz

Risposta di colloquio

Anonimo

6 mag 2019

if (theNumber is divisible by 3) and (theNumber is divisible by 5) then print "FizzBuzz" else if (theNumber is divisible by 3) then print "Fizz" else if (theNumber is divisible by 5) then print "Buzz" else /* theNumber is not divisible by 3 or 5 */ print theNumber end if

2