program SequenceSum;
varn, i, count: integer;d, sum: real;
begincount := 0;sum := 0;
writeln('Enter the number of elements in the sequence: ');readln(n);
writeln('Enter the value of d: ');readln(d);
writeln('Enter the elements of the sequence: ');for i := 1 to n dobeginvar element: real;readln(element);
end;
writeln('The sum of elements less than ', d, ' is: ', sum);writeln('The number of elements less than ', d, ' is: ', count);
end.
program SequenceSum;
var
n, i, count: integer;
d, sum: real;
begin
count := 0;
sum := 0;
writeln('Enter the number of elements in the sequence: ');
readln(n);
writeln('Enter the value of d: ');
readln(d);
writeln('Enter the elements of the sequence: ');
if element < d thenfor i := 1 to n do
begin
var element: real;
readln(element);
begin
count := count + 1;
sum := sum + element;
end;
end;
writeln('The sum of elements less than ', d, ' is: ', sum);
writeln('The number of elements less than ', d, ' is: ', count);
end.