목록코딩 study/C++ (3)
Creative Code
#include #include #include using namespace std; // 16가지 ANSI 컬러를 열거형으로 정의 enum color16 { Black = 0, Blue, Green, Cyan, Red, Magenta, Brown, Lightgray, Darkgray, Lightblue, Lightgreen, Lightcyan, Lightred, Lightmagenta, Yellow, White }; // 콘솔 창 내의 커서 위치를 x, y 좌표로 이동하는 함수 정의 void gotoxy(int x, int y) { COORD pos = { x, y }; // COORD 구조체를 사용하여 커서 위치를 설정합니다. SetConsoleCursorPosition(GetStdHandle(STD..
#include #include #include using namespace std; // 콘솔 창 내의 커서 위치를 x, y 좌표로 이동하는 함수 정의 void gotoxy(int x, int y) { COORD pos = { x, y }; // COORD 구조체를 사용하여 커서 위치를 설정합니다. SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos); // 커서 위치를 변경합니다. } int main() { gotoxy(5, 10); // (5, 10) 위치로 커서 이동 cout