4 ms·
That's more like it! First time I heard about Fizzbuzz, I solved it in PHP. I stay amazed at the 100 lines solutions. for ($i = 1; $i <= 100; $i++) { $s
by segmondy 13y ago
That's more like it!
First time I heard about Fizzbuzz, I solved it in PHP. I stay amazed at the 100 lines solutions.
for ($i = 1; $i <= 100; $i++) {
$str = str_repeat('Fizz', !($i%3)&1) . str_repeat('Buzz', !($i%5)&1);
echo $str ? "$str\n" : "$i\n";
}