var a: array[1..10000] of longint; s: longint;
begin
repeat
readln(a[i]);
s:=s+a[i];
until a[i]=0;
write(s);
readln
end.
var
i,d,n:integer;
s:longint;
a:array [1..32000] of integer;
begin
write(' nhap n: '); readln(n);
for i:= 1 to n do
begin
write('a[',i,']= '); readln(a[i]);
inc(d);
if a[i] = 0 then break;
end;
for i:= 1 to d do
s:= s + a[i];
write(' tong so vua nhap la : ',s);
readln;
end.