uses graph; var n,i,x,y,height,width:integer; procedure init; var gd,gm:integer; begin gd:=vga; gm:=vgahi; initgraph (gd,gm,''); end; procedure error; begin closegraph; writeln ('error!'); end; begin write ('N = '); readln (n); randomize; init; if graphresult = 0 then begin for i:=1 to n do begin
uses graph;
var n,i,x,y,height,width:integer;
procedure init;
var gd,gm:integer;
begin
gd:=vga;
gm:=vgahi;
initgraph (gd,gm,'');
end;
procedure error;
begin
closegraph;
writeln ('error!');
end;
begin
write ('N = ');
readln (n);
randomize;
init;
if graphresult = 0 then
begin
for i:=1 to n do
begin
setcolor (random(14)+1);
x:=random(640);
y:=random(480);
height:=random(91)+10;
width:=random(101)+20;
rectangle (x,y,x+width,y+height);
end;
end else error;
end.