#include <stdio.h>
#define COUNT(number, divisor, result) \
while (number && number % divisor == 0) { \
++result; \
number /= divisor; \
}
#define PRINT(phrase, count) while (count-- > 0) printf(phrase);
int main(void) {
int i;
for (i = 0; i <= 100; ++i) {
if (i % 3 && i % 5) {
continue;
}
int fizz_count = 0, buzz_count = 0, fizzbuzz_count = 0;
int j = i;
COUNT(j, 15, fizzbuzz_count)
COUNT(j, 3, fizz_count)
COUNT(j, 5, buzz_count)
PRINT("Fizz", fizz_count)
PRINT("FizzBuzz", fizzbuzz_count)
PRINT("Buzz", buzz_count)
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIENPVU5UKG51bWJlciwgZGl2aXNvciwgcmVzdWx0KSBcCgl3aGlsZSAobnVtYmVyICYmIG51bWJlciAlIGRpdmlzb3IgPT0gMCkgeyBcCgkJKytyZXN1bHQ7IFwKCQludW1iZXIgLz0gZGl2aXNvcjsgXAoJfQoKI2RlZmluZSBQUklOVChwaHJhc2UsIGNvdW50KSB3aGlsZSAoY291bnQtLSA+IDApIHByaW50ZihwaHJhc2UpOwoKaW50IG1haW4odm9pZCkgewoJaW50IGk7Cglmb3IgKGkgPSAwOyBpIDw9IDEwMDsgKytpKSB7CgkJaWYgKGkgJSAzICYmIGkgJSA1KSB7CgkJCXByaW50ZigiJWRcbiIsIGkpOwoJCQljb250aW51ZTsKCQl9CgkJaW50IGZpenpfY291bnQgPSAwLCBidXp6X2NvdW50ID0gMCwgZml6emJ1enpfY291bnQgPSAwOwoJCWludCBqID0gaTsKCQlDT1VOVChqLCAxNSwgZml6emJ1enpfY291bnQpCgkJQ09VTlQoaiwgMywgZml6el9jb3VudCkKCQlDT1VOVChqLCA1LCBidXp6X2NvdW50KQoJCVBSSU5UKCJGaXp6IiwgZml6el9jb3VudCkKCQlQUklOVCgiRml6ekJ1enoiLCBmaXp6YnV6el9jb3VudCkKCQlQUklOVCgiQnV6eiIsIGJ1enpfY291bnQpCgkJcHJpbnRmKCJcbiIpOwoJfQoJcmV0dXJuIDA7Cn0K