fork download
  1. #include <cstdio>
  2. void fizzbuzz(){
  3. int th,fi,i;
  4. for(th=0,fi=0,i=0;i<16;++i,th=(i%3==0),fi=(i%5==0),!((th&&puts("fizz"))|(fi&&puts("buzz")))&&(printf("%d\n",i)));
  5. }
  6.  
  7. int main() {
  8. fizzbuzz();
  9. return 0;
  10. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
1
2
fizz
4
buzz
fizz
7
8
fizz
buzz
11
fizz
13
14
fizz
buzz
16