Skip to content

Instantly share code, notes, and snippets.

@macrat
Created May 15, 2015 06:42
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 macrat/78e7757aec30e4ac4b04 to your computer and use it in GitHub Desktop.
Save macrat/78e7757aec30e4ac4b04 to your computer and use it in GitHub Desktop.
昨日の続き、今度は一行で階乗の計算。素直過ぎてつまらない。
#include <stdio.h>
int main(int argc, char** argv)
{
return argc == 2 ? printf("%d\n", main(-atoi(argv[1]), argv))==0 : (argc < -1 ? -argc*main(argc+1, argv) : -argc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment