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