program sum_less_x;vararr: array of integer;n, x, i, sum: integer;beginwrite('Enter the number of elements in the array: ');readln(n);
setlength(arr, n);
write('Enter the elements of the array: ');for i := 0 to n-1 doread(arr[i]);
write('Enter the number X: ');readln(x);
sum := 0;
for i := 0 to n-1 dobeginif abs(arr[i]) < x thensum := sum + abs(arr[i]);end;
writeln('The sum of the absolute values of the elements less than ', x, ' is: ', sum);end.
program sum_less_x;
var
arr: array of integer;
n, x, i, sum: integer;
begin
write('Enter the number of elements in the array: ');
readln(n);
setlength(arr, n);
write('Enter the elements of the array: ');
for i := 0 to n-1 do
read(arr[i]);
write('Enter the number X: ');
readln(x);
sum := 0;
for i := 0 to n-1 do
begin
if abs(arr[i]) < x then
sum := sum + abs(arr[i]);
end;
writeln('The sum of the absolute values of the elements less than ', x, ' is: ', sum);
end.