我想通过wasd移动小球,编译能成功但getchar无法使用
#include<iostream>
#include<conio.h>
#include<easyx.h>
#include<windows.h>
int main() {
int x;
int y;
char a;
x = 60;
y = 540;
initgraph(800, 600);
setbkcolor(WHITE);
cleardevice();
setlinecolor(BLACK);
setfillcolor(YELLOW);
fillcircle(x, y, 50);
for (;;) {
a = getchar();
if (a == 'd') {
x++;
}
if (a == 'a') {
x--;
}
if (a == 'w') {
y--;
}
if (a == 's') {
y++;
}
cleardevice();
fillcircle(x, y, 50);
}
}