Nếu có lỗi hoặc đáp án sai thì bạn nói mình để mình sửa nhé, nếu đúng thì cho mình hay nhất với. ^^
program Hello;
uses crt;
var n,i,max,d,s1:integer;
a,s:array[1..1000] of integer;
begin
clrscr;
write('n = ');
readln(n);
max:=low(integer);
for i:= 1 to n do
begin
read(a[i]);
if a[i]<0 then
s1:=s1+a[i];
if (a[i]>=0) or (i=n) then
begin
s[i]:=s1;
s1:=0;
end;
end;
for i:=1 to n do
if s[i]<0 then
begin
if (max = s[i]) then inc(d);
if (max<s[i]) then
begin
max:=s[i];
d:=1;
end;
end;
write('So luong cac so hang am co tong lon nhat la: ',d);
end.