diff options
feat(Week06): Add exercises and solutions
1 files changed, 19 insertions, 0 deletions
| -rw-r--r-- | Week06/Exercise14.cpp | 19 |
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 <iostream> + +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; +} |
