program ct;
uses crt;
var A:array[1..100] of integer;
i,n,m:integer;
S:longint;
begin clrscr;
write('Nhap so phan tu n: '); readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': '); readln(A[i]);
end;
for i:=1 to n do
if i=n then m:=A[i];
S:=A[1]+m;
writeln('Tong la: ',S);
readln;
end.
Học tốt!