program Kvardat; uses crt,graph; var drajver,rezim,pom:integer; a,a0,x,y,x1,x2,y1,y2,x11:integer; begin ClrScr; write(' Unesi duzinu stranice kvadrata : '); readln(a); a0:=a*5; initgraph(drajver,rezim,''); if (a0>0) and (a0<(GetMaxY div 2)) then begin x:=(GetMaxX+1) div 2; y:=(GetMaxY+1) div 2; x1:=x-a0; y1:=y-a0; x2:=x+a0; y2:=y+a0; rectangle(x1,y1,x2,y2); readln; closegraph end else begin write(' Kvadrat se za datu duzinu ne vidi, a je u [0,',GetMaxY div 5,']!'); readln end end. |
|