uses crt;
var a:array[1..255]of longint;
k,i,n,t:longint;
begin
clrscr;
repeat
write('Nhap so phan tu:'); readln(n);
until (0<n) and (n<=255);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Nhap k='); readln(k);
t:=0;
for i:=1 to n do
if a[i]<k then t:=t+a[i];
writeln('Tong cac so nho hon ',k,' trong day la: ',t);
readln;
end.