#include <conio.h>
#include <stdlib.h>
#include <graphics.h>
#include <stdio.h>
void fillsquare()
{
char buffer[16],number;
int EOI=1;
while(EOI)
{
number=getch();
if(number>=49 && number<=57)
{
buffer[0]=number;
outtextxy(50,50,buffer);
break;
}
}
}
int main()
{
int g_dr=DETECT, g_mod, result;
initgraph(&g_dr, &g_mod, " ");
if((result=graphresult())!=grOk) return(1);
int ry,rx;
while(1)
{
getmouseclick(WM_LBUTTONDOWN,rx,ry);
if((rx>=0 && rx<=639) && (ry>=0 && rx<=479)) fillsquare();
}
closegraph();
}