From 80b6fffdf40a04ed7fa719b038ee4d5380dd3a87 Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 4 Sep 2024 19:56:28 +0200 Subject: more --- 6p4.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 6p4.cpp (limited to '6p4.cpp') diff --git a/6p4.cpp b/6p4.cpp new file mode 100644 index 0000000..28c6fa5 --- /dev/null +++ b/6p4.cpp @@ -0,0 +1,26 @@ +#include + +/* + * + * 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; +} -- cgit v1.2.3