#include #include #include #include #include #include std::locale utf8loc(std::locale(), new std::codecvt_utf8); using namespace std; double exponentiation(double base, int powerArg) noexcept { int power = powerArg; double result = 1; while (power > 0) { result *= base; --power; } return result; } int main(int argc, char **argv) { setlocale(LC_ALL, "en_US.UTF-8"); wcout.imbue(utf8loc); wcin.imbue(utf8loc); for (double b = 1.1; b < 2.05; b += 0.1) { for (int p = 2; p <= 10; ++p) { wcout << fmt::format(L"{0:f} ^ {1:d} = {2:f}", b, p, exponentiation(b, p)) << endl; } } return 0; }