diff options
Diffstat (limited to '6p4.cpp')
-rw-r--r-- | 6p4.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -0,0 +1,26 @@ +#include <iostream> + +/* + * + * 6.4 + * + * + */ + +uint64_t fact(void) { + + uint64_t val; + if(std::cin >> val) {} else { return 0; } + uint64_t ret = 1; + while(val > 1) { + ret *= val--; + } + + return ret; +} + +int main () { + + std::cout << fact() << std::endl; + return 0; +} |