заменить первый отрицательный член массива нулем
var a:array[1..10] of integer;
i,t:integer;
Begin
for i := 1 to 10 do
read(a[i]);
for i := 1 to 10 do begin
if (a[i]<0) and t=0 then begin
a[i]:=0;
t:=1;
end;
writeln(a[i]);
End.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
var a:array[1..10] of integer;
i,t:integer;
Begin
for i := 1 to 10 do
read(a[i]);
for i := 1 to 10 do begin
if (a[i]<0) and t=0 then begin
a[i]:=0;
t:=1;
end;
writeln(a[i]);
end;
End.