24,855
社区成员
发帖
与我相关
我的任务
分享
#pragma comment(lib,"user32")
#pragma comment(lib,"gdi32")
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
wchar_t s[]=L"我是菜鸟,求大神指教 | I was a rookie, and great advice | 내가 니들한테 어리바리. 제발 바랍니다 | 私は初心者で、求大神お願いします";
wchar_t seps[]=L"|";
wchar_t *token1=NULL;
wchar_t *next_token1 = NULL;
int wmain() {
HWND hwnd;
HDC hdc;
HFONT hfont;
int x,y;
system("color F0");
system("cls");
x=8;
y=8;
hwnd = GetConsoleWindow();
hdc = GetDC(hwnd);
hfont = CreateFont(16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "宋体");
SelectObject(hdc,hfont);
token1 = wcstok_s( s, seps, &next_token1);
while (1) {
if (token1 != NULL) {
TextOutW(hdc,x,y,token1,wcslen(token1));
y+=20;
token1 = wcstok_s( NULL, seps, &next_token1);
} else break;
}
DeleteObject(hfont);
ReleaseDC(hwnd,hdc);
getchar();
system("color 07");
system("cls");
return 0;
}