diff options
Diffstat (limited to 'fact.cc')
-rw-r--r-- | fact.cc | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +#include <iostream> + +/* + * + * + * + * + */ + +uint64_t fact_i(void) { + + uint64_t val; + if(std::cin >> val) {} else { return 0; } + uint64_t ret = 1; + while(val > 1) { + ret *= val--; + } + + return ret; +} |