#include<atlbase.h>
#include <statreg.h>
#include<iostream>
#include <windows.h>
#include <conio.h>
using namespace std;
void gotoxy(int x,int y)
{
COORD coord;
coord.X=x;
coord.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
}
int main()
{int g=20;
char d,s;
d='*';
gotoxy(20,20);
cout<<d;
while(1)
{s=getch();
switch(s)
{case 40:
{g-=1;
gotoxy(20,g);
cout<<d;}
break;
case 39:
{ g+=1;
gotoxy(g,20);
cout<<d;}
break;
case 38:
{g+=1;
gotoxy(20,g);
cout<<d;}
break;
default:
case 37:
{g-=1;
gotoxy(g,20);
cout<<d;}
break;
}
}
getch();
}