перевести код из паскаля в фортран f90 var i, j, k, s, x, y:integer;
a:array[1..7,1..7] of integer;
begin
x:=2;
y:=6;
for k:=1 to 4 do
begin
for i:=x-1 to y+1 do
begin
s:=s+1;
a[x-1,i]:=s;
end;
for j:=x to y+1 do
begin
s:=s+1;
a[j,i]:=s;
end;
for i:=y downto x-1 do
begin
s:=s+1;
a[y+1,i]:=s;
end;
for j:=y downto x do
begin
s:=s+1;
a[j,i]:=s;
end;
x:=x+1;
y:=y-1;
end;
writeln('massive 15 = ');
for i:=1 to 7 do
begin
for j:=1 to 7 do
write(a[i,j]:5);
writeln;
end;
end.
Program F90
integer i, j, k, s /0/, x/2/, y/6/, a(7, 7)
do k = 1, 4
do i = x - 1, y + 1
s = s + 1
a(x - 1, i) = s
end do
i = y + 1
do j = x, y + 1
s = s + 1
a(j, i) = s
end do
do i = y, x - 1, -1
s = s + 1
a(y + 1, i) = s
end do
i = x - 1
do j = y, x, -1
s = s + 1
a(j, i) = s
end do
x = x + 1
y = y - 1
end do
Print *, 'massive 15 = '
Write(*, '(7i5)') ((a(i, j), j=1, 7), i=1, 7)
End Program