#include <iostream>
#include <locale>
#include <cstdio>
int main()
{
    using namespace std;
	locale loc(locale("ja_JP.UTF-8"));
	locale::global(loc);
	cout.imbue(loc);
	wcout.imbue(loc);

	ios::sync_with_stdio(false);
	//~ cout << "[cout]" << endl;
	//~ wcout << L"[wcout]" << endl;
	printf("[printf]\n"); fflush(stdout);
	//~ wprintf(L"[wprintf]\n"); fflush(stdout);

	cout << "cout あいうえお" << endl;
	wcout << L"wcout あいうえお" << endl;
	printf("printf あいうえお\n"); fflush(stdout);
	wprintf(L"wprintf あいうえお\n"); fflush(stdout);
	return 0;
}