Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 13 / task3.cpp
diff options
context:
space:
mode:
1 files changed, 14 insertions, 0 deletions
-rw-r--r--Sem. 13/task3.cpp14
diff --git a/Sem. 13/task3.cpp b/Sem. 13/task3.cpp
new file mode 100644
index 0000000..a17bdb0
--- /dev/null
+++ b/Sem. 13/task3.cpp
@@ -0,0 +1,14 @@
+#include <iostream>
+using namespace std;
+
+unsigned power(unsigned n, unsigned k)
+{
+ if (k == 0)
+ return 1;
+ return n * power(n, k - 1);
+}
+
+int main()
+{
+ cout << power(2,7);
+} \ No newline at end of file