fork download
  1. #include <iostream>
  2. #include <locale>
  3. int main()
  4. {
  5. // using system narrow character encoding
  6. // (UTF-8 except on Windows)
  7. std::cout << "3² = 9\n"
  8. << "√9 = 3\n";
  9. // using system wide character encoding
  10. // (UCS4 except on Windows)
  11. std::wcout.sync_with_stdio(false); // or set the C locale too
  12. std::wcout.imbue(std::locale(""));
  13. std::wcout << L"3² = 9\n"
  14. << L"√9 = 3\n";
  15. }
  16.  
Success #stdin #stdout 0s 5036KB
stdin
Standard input is empty
stdout
3² = 9
√9 = 3
3² = 9
√9 = 3