PascalABC
var
a:array[1..10,1..10]of longint;
i,j:longint;
begin
for i:=1 to 10 do
for j:=1 to 10 do
if (i mod 2 <> 0) then
a[i,j]:=j
else
a[i,j]:=10-j+1;
end;
write(a[i,j],' ');
writeln;
end.
===== PascalABC.NET =====
var n := 10;
var a := MatrGen(n, n, (i, j) -> i.IsEven ? j + 1 : n - j);
a.Println(3)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
PascalABC
var
a:array[1..10,1..10]of longint;
i,j:longint;
begin
for i:=1 to 10 do
for j:=1 to 10 do
begin
if (i mod 2 <> 0) then
a[i,j]:=j
else
a[i,j]:=10-j+1;
end;
for i:=1 to 10 do
begin
for j:=1 to 10 do
write(a[i,j],' ');
writeln;
end;
end.
Verified answer
===== PascalABC.NET =====
begin
var n := 10;
var a := MatrGen(n, n, (i, j) -> i.IsEven ? j + 1 : n - j);
a.Println(3)
end.