program tinh_tong;
uses crt;
var A:array[1..1000] of integer;
n,i,t:integer;
begin
clrscr;
write('Nhap n: '); readln(n);
t:=0;
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(A[i]);
if (A[i]>5) and (A[i]<100) then t:=t+A[i];
end;
write('Tong cac so lon hon 5 va be hon 100 trong mang la: ',t);
readln;
end.