Код: Выделить всё
#include<conio.h>
#include<stdio.h>
#include<dos.h>
#include<graphics.h>
#include<math.h>
#define PATHTODRIVER "D:\\BC\\BC\\BIN\\"
void main (void)
{int gdriver=DETECT;
int gmode;
int errorcode;
initgraph (&gdriver, &gmode, PATHTODRIVER);
errorcode=graphresult();
if (errorcode!=grOk)
{printf( "yak%d\n", errorcode);
getch();
return;}
int x1=280, y1=200, x2=0, y2=0, a=0;
printf ("vvedite a=");
scanf ("5d", &a);
x2=x1+a;
y2=y1+a;
setfillstyle (SOLID_FILL, 3);
bar(x1, y1, x2, y2);
outtextxy (x1-10, y1, "1");
outtextxy(x1-10, y2, "2");
outtextxy (x2+10, y1, "3");
outtextxy (x2+10, y2, "4");
printf ("\n nagmite ili 1 ili 2 ili 3 ili 4");
a=getch();
if(a==49)
putpixel(x1, y1, 5);
if(a==50)
putpixel(x1, y2, 5);
if(a==51)
putpixel(x2, y1, 5 );
if (a==52)
putpixel(x2, y2, 5);
getch();}