Uses crt;
var a,b:array[1..100] of integer; i,j,k,n:integer;
procedure rmassr;
begin
for i:=1 to n do begin
a[i]:=random(10);
end;
end;
procedure rmassy;
begin
for i:=1 to n do begin
readln(a[i]);
end;
end;
procedure rmass();
begin
for i:=1 to n do begin
write(a[i],' ');
end;
end;
procedure newmass;
begin
for i:=1 to n do begin
if a[i] > 0 then b[i]:=a[i];
end;
for i:=1 to n do begin
j:=j+b[i];
end;
writeln('summa = ',j);
end;
begin
clrscr;
randomize;
write('длина массива '); readln(n);
write('1-random; 2-в ручную'); readln(k);
if k = 1 then
rmassr()
else rmassy();
rmass();
writeln();
newmass();
readln
end.