#include #include #include #include #include #include std::locale utf8loc(std::locale(), new std::codecvt_utf8); using namespace std; long factorial(int x) noexcept { if (x <= 1) { return 1; } return x * factorial(x - 1); } int main(int argc, char **argv) { setlocale(LC_ALL, "en_US.UTF-8"); wcout.imbue(utf8loc); wcin.imbue(utf8loc); for (int x = 1; x < 10; ++x) { wcout << fmt::format(L"{0:d}! = {1:d}", x, factorial(x)) << endl; } return 0; }