Website Summary Files Commits Branches @commit @diff @stats
path: root / Week06 / Exercise14.cpp
blob: 86e3a32f0ac955c7d7eba4dfa7fddf742c72e915 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;
}