#include #include #include #include #include #include //f:[-90,90]->R, y=ax+b int gd,gm,a=2,b=10,x0,y0, x,y,i,j,dx=50,petale,culoare; void main(void) { clrscr(); randomize(); printf("y=a*x+b\n"); // printf("a="); // scanf("%d",&a); // printf("b="); // scanf("%d",&b); // printf("dom de def\n"); // printf("dx="); // scanf("%d",&dx); printf("cate petale"); scanf("%d",&petale); if (a!=0) x0=-b/a; y0=b; detectgraph(&gd,&gm); initgraph(&gd,&gm,"C:\\borlandc\\bgi"); /* moveto(100,100); outtextxy(150,100,"x"); moveto(100,100); linerel(50,100); outtextxy(150,200,"y");*/ line(100,240,540,240); // outtextxy(497,237,">"); moveto(540,240); linerel(-5,-5); moveto(540,240); linerel(-5,5); line(320,50,320,400); moveto(320,50); linerel(-5,5); moveto(320,50); linerel(5,5); //line(320,240-y0,320+x0,240); for (i=-dx;i10;j--) { for (i=-dx/2;i