1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#ifdef WINDOWS
#include <windows.h>
#endif
using namespace std;
void clear_screen(){
#ifdef WINDOWS
system("cls");
#else
system("clear");
#endif
}
void gotoxy(int x,int y){
#ifdef WINDOWS
COORD c;
c.X = x - 1;
c.Y = y - 1;
SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
#else
printf("%c[%d;%df",0x1B,y,x);
#endif
}
int main()
{
clear_screen();
gotoxy(20,20);
cout << "test";
return 0;
} |