Add ege2.cpp

This commit is contained in:
daleclack 2020-09-15 20:52:45 +08:00 committed by GitHub
parent 8895ac3c10
commit d484bef85d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

16
ege/ege2.cpp Normal file
View File

@ -0,0 +1,16 @@
#include<graphics.h>
#include<cstdio>
int main(){
initgraph(400,300);//create a wimdow
setfont(16,0,"SimSum");//set font and size
for(;is_run();dely_fps(60)){
cleardevice();//cls
int x,y;
char str[30];
mousepos(&x,&y);//get mouse position
sprintf(str,"%4d %4d",x,y);//transform to string
outtextxy(0,0,str);
}
closegraph();
return 0;
}