Skip to content

Instantly share code, notes, and snippets.

@glukianets
Created August 13, 2019 09:43
Show Gist options
  • Save glukianets/3a0f88ffd2f7733c6d7f37e645daf099 to your computer and use it in GitHub Desktop.
Save glukianets/3a0f88ffd2f7733c6d7f37e645daf099 to your computer and use it in GitHub Desktop.
// Code golf: print factorial value of a highest digit in a number, function signature:
// int fact(int n)
int fact(int n) {return n>0?MAX(n%10*fact(n%10-1),fact(n/10)):1;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment