summaryrefslogtreecommitdiff
path: root/fact.cc
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-09-05 11:18:52 +0200
committerOskar <[email protected]>2024-09-05 11:18:52 +0200
commitd2f183b8d0008bdb29e6c5c4fa04c14d7525ca9b (patch)
treed1ab4ddc3cea4214ffdb8f574a85283545b372f8 /fact.cc
parenta30d605024322ada2206d10898b8dfd6220107c1 (diff)
more
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;
+}