Var sum, count, t : integer; begin sum := 0; count := 0; while not eoln do begin read (t); if t > 0 then begin sum := sum + t; count := count + 1; end; writeln (sum, ' ', count); end.
если количество элементов указано var sum, count, t, n, i : integer; begin sum := 0; count := 0; read (n); for i := 1 to n do begin read (t); if t > 0 then begin sum := sum + t; count := count + 1; end; writeln (sum, ' ', count); end.
sum, count, t : integer;
begin
sum := 0; count := 0;
while not eoln do
begin
read (t);
if t > 0 then
begin
sum := sum + t;
count := count + 1;
end;
writeln (sum, ' ', count);
end.
если количество элементов указано
var
sum, count, t, n, i : integer;
begin
sum := 0; count := 0;
read (n);
for i := 1 to n do
begin
read (t);
if t > 0 then
begin
sum := sum + t;
count := count + 1;
end;
writeln (sum, ' ', count);
end.