diff options
author | Oskar <[email protected]> | 2024-09-05 11:18:52 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-09-05 11:18:52 +0200 |
commit | d2f183b8d0008bdb29e6c5c4fa04c14d7525ca9b (patch) | |
tree | d1ab4ddc3cea4214ffdb8f574a85283545b372f8 /fact.cc | |
parent | a30d605024322ada2206d10898b8dfd6220107c1 (diff) |
more
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; +} |