Tham khảo
uses crt;
var a:array[1..500]of integer;
n,i,t:integer;
Begin
clrscr;
write('n = ');readln(n);
for i:=1 to n do
begin
write('a[',i,'] = ');readln(a[i]);
t:=t+a[i];
end;
write('tong = ',t);
readln