Website Summary Files Commits Branches @commit @diff @stats
path: root / Week05 / Exercise04.cpp
blob: d7d4b1b24e190d928d70782caed2fbe29963778a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>

int main() {
    unsigned int factorial_max, power;
    std::cin >> factorial_max >> power;

    unsigned int factorial = 1;
    for (unsigned int i = 1; i <= factorial_max; i++) {
        factorial *= i;
    }

    unsigned int to_power = 1;
    for (unsigned int i = 1; i <= power; i++) {
        to_power *= factorial;
    }

    std::cout << to_power;

    return 0;
}