求大神帮我看看为什么运行后按键符号老是动不了
#include<stdio.h>#include<stdlib.h>
#include<windows.h>
#include<conio.h>
int x=50,y=10;
char key;
void gotoxy(int x,int y);
void draw(int x,int y);
void draw(int x,int y)
{
system("cls");
gotoxy(x,y);
printf("&");
}
void gotoxy(int x,int y)
{
HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE);
COORD pos={x,y};
SetConsoleCursorPosition(hOut,pos);
}
int main()
{
draw(x,y);
while(1)
{
if(kbhit())
{
switch(key=getchar())
{
case 'w':{
draw(x,y-1);
break;
}
case 's':{draw(x,y+1);break;}
}
}
}
}