{FOR Dongusu kullanilarak} PROGRAM Delahaout; USES CRT, DOS, GRAPH; VAR gs, gm, i,j, ara: INTEGER;
BEGIN WRITELN('Lutfen 5 ile 300 arasinda bir tam sayi degerini yaziniz: '); READLN(ara);
gs:=DETECT; INITGRAPH (gs, gm,'C:\TP\BGI'); IF GRAPHRESULT<>GROK THEN HALT(1); CLEARDEVICE
{ilk dort dortgenin cizimi} setfillstyle (1, 14); bar (0, 0, getmaxx div 2, getmaxy div 2); setfillstyle (1, 1); bar (getmaxx div 2, 0, getmaxx, getmaxy div 2); setfillstyle (1, 2); bar (0, getmaxy div 2, getmaxx div 2, getmaxy); setfillstyle (1, 6); bar (getmaxx div 2, getmaxy div 2, getmaxx,getmaxy);
araX := round((getmaxx- (4 * ara)) div 3) + ara; araY := round((getmaxy - (4* ara)) div 3) + ara;
FOR j:= 1 TO 3 DO begin FOR i:= 1 TO 3 DO begin setfillstyle(1, (i+2) * j); bar(ara + (i-1)* araX , ara + (j-1) * araY, i * araX , j * araY); end; end;
{FOR Dongusu kullanilarak}
YanıtlaSilPROGRAM Delahaout;
USES CRT, DOS, GRAPH;
VAR gs, gm, i,j, ara: INTEGER;
BEGIN
WRITELN('Lutfen 5 ile 300 arasinda bir tam sayi degerini yaziniz: ');
READLN(ara);
gs:=DETECT;
INITGRAPH (gs, gm,'C:\TP\BGI');
IF GRAPHRESULT<>GROK THEN HALT(1);
CLEARDEVICE
{ilk dort dortgenin cizimi}
setfillstyle (1, 14);
bar (0, 0, getmaxx div 2, getmaxy div 2);
setfillstyle (1, 1);
bar (getmaxx div 2, 0, getmaxx, getmaxy div 2);
setfillstyle (1, 2);
bar (0, getmaxy div 2, getmaxx div 2, getmaxy);
setfillstyle (1, 6);
bar (getmaxx div 2, getmaxy div 2, getmaxx,getmaxy);
araX := round((getmaxx- (4 * ara)) div 3) + ara;
araY := round((getmaxy - (4* ara)) div 3) + ara;
FOR j:= 1 TO 3 DO
begin
FOR i:= 1 TO 3 DO
begin
setfillstyle(1, (i+2) * j);
bar(ara + (i-1)* araX ,
ara + (j-1) * araY, i * araX , j * araY);
end;
end;
READLN;
CLOSEGRAPH;
END.