Вот для pascal.
var x: array [1..100] of Integer; i,n: Integer; s: Integer;
begin writeln('Skolko elementov'); read(n); s := 0; for i := 1 to n do begin Write('x[', i, '] = '); Readln(x[i]);
if (x[i] > 0) and (x[i] < 10) then s := s + x[i]; end; Writeln(s);end.
Вот для pascal.
var
x: array [1..100] of Integer;
i,n: Integer;
s: Integer;
begin
writeln('Skolko elementov');
read(n);
s := 0;
for i := 1 to n do begin
Write('x[', i, '] = ');
Readln(x[i]);
if (x[i] > 0) and (x[i] < 10) then s := s + x[i];
end;
Writeln(s);
end.