- #include<windows.h>
- int setxy(int x,int y)
- {
- HANDLE hout;
- COORD coord;
- coord.X=x;
- coord.Y=y;
- hout=GetStdHandle(STD_OUTPUT_HANDLE);
- SetConsoleCursorPosition(hout,coord);
- return 0;
- }
- //该片段来自于http://www.codesnippet.cn/detail/231020136593.html
来源: http://www.codesnippet.cn/detail/231020136593.html