===== PascalABC.NET =====
procedure CShL(var a: array of real) :=
// циклический сдвиг влево на 1 элемент
a := a[1:] + Arr(a[0]);
begin
var n := ReadInteger('n =');
var a := SeqRandomReal(n, -99, 99)
.Select(p -> Round(p, 1))
.ToArray;
var b := new real[n, n];
for var i := 0 to n - 1 do
b.SetRow(i, a);
CShL(a)
end;
b.Println(6, 1)
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
===== PascalABC.NET =====
procedure CShL(var a: array of real) :=
// циклический сдвиг влево на 1 элемент
a := a[1:] + Arr(a[0]);
begin
var n := ReadInteger('n =');
var a := SeqRandomReal(n, -99, 99)
.Select(p -> Round(p, 1))
.ToArray;
var b := new real[n, n];
for var i := 0 to n - 1 do
begin
b.SetRow(i, a);
CShL(a)
end;
b.Println(6, 1)
end.