Program Z_3; uses crt; const n=5; var i,j,s,d:byte;a:array[1..5,1..5]of byte; begin for i:=1 to n do begin for j:=1 to n do begin if (i=1+s)and(j=n-s) then begin d:=1; a[i,j]:=10;end; if d=0 then a[i,j]:=1 else if (i=1+s)and(j=n-s) then a[i,j]:=10; write(' ',a[i,j],' '); end; writelns:=s+1;d:=0; end; end.
program Z_4; uses crt; const n=5; var i,j,m:byte;a:array[1..5,1..5]of byte; begin m:=1;j:=n; for j:=n downto 1 do for i:=1 to n do begin a[j,i]:=m; m:=m+1; end; end; for i:=1 to n do begin for j:=1 to n do if a[i,j]<10 then write(' 0',a[i,j],' ') else write(' ',a[i,j],' '); writeln; end; end.
uses crt;
const n=5;
var i,j,s,d:byte;a:array[1..5,1..5]of byte;
begin
for i:=1 to n do
begin
for j:=1 to n do
begin
if (i=1+s)and(j=n-s) then begin d:=1; a[i,j]:=10;end;
if d=0 then a[i,j]:=1
else if (i=1+s)and(j=n-s)
then a[i,j]:=10;
write(' ',a[i,j],' ');
end;
writelns:=s+1;d:=0;
end;
end.
program Z_4;
uses crt;
const n=5;
var i,j,m:byte;a:array[1..5,1..5]of byte;
begin
m:=1;j:=n;
for j:=n downto 1 do
for i:=1 to n do
begin a[j,i]:=m; m:=m+1; end;
end;
for i:=1 to n do
begin
for j:=1 to n do
if a[i,j]<10
then write(' 0',a[i,j],' ')
else write(' ',a[i,j],' ');
writeln;
end;
end.