var mass: array [1..20] of integer;
i,n:integer;
begin
writeln('Изначальный массив: ');
randomize;
for i:=1 to 20 do begin
mass[i]:=random(30);
write(mass[i],' ');
end;
writeln('Новый массив: ');
if i<=10 then
mass[i]:= mass[i]+4;
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Uses crt;
var i,n: integer;
a:array[1..100] of integer;
begin clrscr;
randomize;
write('Pazmer massiva = ');
readln(n);
for i:=1 to n do
a[i]:= random(100)-50;
for i:=1 to n do
write(a[i]:5);
writeln;
writeln;
for i:=1 to (n div 2) do
write((a[i]+4):5);
for i:=((n div 2)+1) to n do
write(a[i]:5);
readln;
end.
var mass: array [1..20] of integer;
i,n:integer;
begin
writeln('Изначальный массив: ');
randomize;
for i:=1 to 20 do begin
mass[i]:=random(30);
write(mass[i],' ');
end;
writeln('Новый массив: ');
for i:=1 to 20 do begin
if i<=10 then
mass[i]:= mass[i]+4;
write(mass[i],' ');
end;
end.