program r; const n=20; var mas:array [0..n,0..n] of byte; i,j,g,m,a,x1,y1,x2,y2,maxx,maxy,minx,miny:integer; begin
readln (a); for i:=1 to n do for j:=1 to m do mas[i,j]:=0;
for g:=1 to a do begin Readln (x1,y1,x2,y2); if x1>x2 then begin maxX:=x1;minX:=x2;end else begin maxX:=x2; minX:=x1; end; if y1>y2 then begin maxY:=y1;minY:=y2;end else begin maxY:=y2; minY:=y1;end;
m:=0; for i:=miny+1 to maxy do for j:=minx+1 to maxx do if mas[i,j]=0 then begin mas [i,j]:=1;m:=m+1;end; for i:=1 to n do begin for j:=1 to n do write (mas[i,j]); writeln; end; writeln (m);
program 1 var a: array [1..100] of real; N, i: integer; max: real; maxind: integer; begin readln (n); for i:=1 to N do read (a[i]); max := a[1]; maxind := 1; for i:=2 to N do if a[i]>max then begin max := a[i]; maxind := i; end;
Answers & Comments
program r;
const n=20;
var mas:array [0..n,0..n] of byte;
i,j,g,m,a,x1,y1,x2,y2,maxx,maxy,minx,miny:integer;
begin
readln (a);
for i:=1 to n do
for j:=1 to m do
mas[i,j]:=0;
for g:=1 to a do
begin
Readln (x1,y1,x2,y2);
if x1>x2 then begin maxX:=x1;minX:=x2;end
else begin maxX:=x2; minX:=x1; end;
if y1>y2 then begin maxY:=y1;minY:=y2;end
else begin maxY:=y2; minY:=y1;end;
m:=0;
for i:=miny+1 to maxy do
for j:=minx+1 to maxx do
if mas[i,j]=0 then begin mas [i,j]:=1;m:=m+1;end;
for i:=1 to n do
begin
for j:=1 to n do
write (mas[i,j]);
writeln;
end;
writeln (m);
end;
end.
program 1
var
a: array [1..100] of real;
N, i: integer;
max: real;
maxind: integer;
begin
readln (n);
for i:=1 to N do
read (a[i]);
max := a[1];
maxind := 1;
for i:=2 to N do
if a[i]>max then
begin
max := a[i];
maxind := i;
end;
writeln('Максимальный элемент: ',max);
writeln('Индекс максимального элемента: ',maxind);
end.