uses crt;
var t,i,n:longint;
a:array[1..1000]of integer;
begin
t:=0;
write('nhap do dai mang:');readln(n);
for i:=1 to n do begin
write('nhap phan tu thu ',i,' :');readln(a[i]);
if a[i] >0 then t:=t+a[i];
end;
writeln('tong cua mang la :',t);
readln
end.
uses crt;
var i,n,s:longint;
a:array[1..1000000] of longint;
begin
clrscr;
write('Nhap n: ');readln(n);
for i:=1 to n do
begin
write('a[',i,'] = ');readln(a[i]);
end;
for i:=1 to n do
if a[i]>0 then s:=s+a[i];
write('Tong cac phan tu lon hon 0 la: ',s);
readln
end.