fork(3) download
  1. #include <iostream>
  2. #include <locale>
  3. #include <cstdio>
  4. int main()
  5. {
  6. using namespace std;
  7. locale loc(locale("ja_JP.UTF-8"));
  8. locale::global(loc);
  9. cout.imbue(loc);
  10. wcout.imbue(loc);
  11.  
  12. //~ ios::sync_with_stdio(false);
  13. //~ cout << "[cout]" << endl;
  14. //~ wcout << L"[wcout]" << endl;
  15. printf("[printf]\n"); fflush(stdout);
  16. //~ wprintf(L"[wprintf]\n"); fflush(stdout);
  17.  
  18. cout << "cout あいうえお" << endl;
  19. wcout << L"wcout あいうえお" << endl;
  20. printf("printf あいうえお\n"); fflush(stdout);
  21. wprintf(L"wprintf あいうえお\n"); fflush(stdout);
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5892KB
stdin
Standard input is empty
stdout
[printf]
cout あいうえお
wcout BDFHJ
printf あいうえお