#include<iostream> using std::cin; using std::cout; using std::wcin; using std::wcout; using std::endl; int main() { char *a = new char[100]; wchar_t *b = new wchar_t[100]; cin >> a; wcin >> b; cout << a << endl; wcout << b <<endl; delete[] a; delete[] b; return 0; }
#include<iostream> #include<string.h> using namespace std; int main() { ios::sync_with_stdio(false); std::locale::global(std::locale("zh_CN.UTF8")); char *a = new char[100]{'\0'}; wchar_t *b = new wchar_t[100]{L'\0'}; //cin >> a; //cin.clear(); wcin >> b; //cout << a << endl; //cout.clear(); wcout << b <<endl; //wcout.clear(); //wcout << b; //wcout << endl; //cout << wcslen(b) << endl; cout << "hell" << endl; return 0; }
――――――――――――――――――――――END――――――――――――――――――――――