diff options
added sem 13
1 files changed, 15 insertions, 0 deletions
| -rw-r--r-- | Sem. 13/task1.cpp | 15 |
diff --git a/Sem. 13/task1.cpp b/Sem. 13/task1.cpp new file mode 100644 index 0000000..bd2ce93 --- /dev/null +++ b/Sem. 13/task1.cpp @@ -0,0 +1,15 @@ +#include <iostream> +using namespace std; + +unsigned fact(unsigned n) +{ + if (n == 0) + return 1; + + return n * fact(n - 1); +} + +int main() +{ + cout << fact(5); +}
\ No newline at end of file |
