Program Project1;
var m:array of integer; res, n, i:integer;
begin
repeat
write('n: '); readln(n);
SetLength(m, Length(m)+1);
m[Length(m)-1]:=n;
until n=0;
res:=0;
for i:=1 to Length(m)-1 do
if m[i]<0 then res:=res+m[i];<br>
writeln('Result:=', res);
readln;
end.