From ec8ecd4dc19854007428761c330303854478201f Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 6 Nov 2025 19:13:54 +0200 Subject: feat(Week06): Add exercises and solutions --- Week06/Exercise14.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Week06/Exercise14.cpp (limited to 'Week06/Exercise14.cpp') diff --git a/Week06/Exercise14.cpp b/Week06/Exercise14.cpp new file mode 100644 index 0000000..86e3a32 --- /dev/null +++ b/Week06/Exercise14.cpp @@ -0,0 +1,19 @@ +#include + +int main() { + unsigned int base, tetration; + std::cin >> base >> tetration; + + unsigned long long product = 1, pow = base; + for (unsigned int tetr = 0; tetr < tetration - 1; tetr++) { + for (unsigned int i = 0; i < pow; i++) { + product *= base; + } + pow = product; + product = 1; + } + + std::cout << pow << std::endl; + + return 0; +} -- cgit v1.3.1-23-gd82d