summaryrefslogtreecommitdiff
path: root/fact.cc
diff options
context:
space:
mode:
Diffstat (limited to 'fact.cc')
-rw-r--r--fact.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/fact.cc b/fact.cc
new file mode 100644
index 0000000..a79d2b7
--- /dev/null
+++ b/fact.cc
@@ -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;
+}