Skip to content

Instantly share code, notes, and snippets.

@Leonetienne
Last active November 15, 2021 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Leonetienne/f1049ccae4947c70bda9db51fa8c62a8 to your computer and use it in GitHub Desktop.
Save Leonetienne/f1049ccae4947c70bda9db51fa8c62a8 to your computer and use it in GitHub Desktop.
Challange to create the shortest* FizzBuzz (1 <= n <= 20) program that'll compile as-is with a C++ compiler without special options.
#include<stdio.h>
int main(){for(int i=0;i++<20;)if(i%3&&i%5)printf("%d\n",i);else printf("%s%s\n",i%3?"":"Fizz",i%5?"":"Buzz");}
*Every char counts. Even spaces and linebreaks.
Current best:
129 chars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment