Ответ:
var
i:integer;
c:array [1..15] of integer;
a:array [1..15] of integer;
begin
for i:=1 to 15 do begin
c[i]:=Random (100);
end;
if (c[i] mod 2 = 0) then
a[i]:= c[i] div 2
else
a [i]:= c [i] *2;
write ('Массив С: ');
write (c [i]);
write (' ');
writeln (' ');
write ('Массив A: ');
write (a[i]);
end.
Объяснение:
// PascalABC.NET 3.6
var c := ReadArrInteger('Вводи:', 10);
var a := c.Select((v, i) -> i.IsEven ? 2 * v : v * v).ToArray;
a.Print
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
var
i:integer;
c:array [1..15] of integer;
a:array [1..15] of integer;
begin
for i:=1 to 15 do begin
c[i]:=Random (100);
end;
for i:=1 to 15 do begin
if (c[i] mod 2 = 0) then
a[i]:= c[i] div 2
else
a [i]:= c [i] *2;
end;
write ('Массив С: ');
for i:=1 to 15 do begin
write (c [i]);
write (' ');
end;
writeln (' ');
write ('Массив A: ');
for i:=1 to 15 do begin
write (a[i]);
write (' ');
end;
end.
Объяснение:
// PascalABC.NET 3.6
begin
var c := ReadArrInteger('Вводи:', 10);
var a := c.Select((v, i) -> i.IsEven ? 2 * v : v * v).ToArray;
a.Print
end.