var i,n: integer; inf,outf: file of integer; begin randomize; write('количество чисел: '); readln(n); assign(outf,'a.dgt'); rewrite(outf); for i:=1 to n do write(outf,random(-100,100)); close(outf); {чтение из А и запись положительных в В} assign(inf,'a.dgt'); reset(inf); assign(outf,'b.dgt'); rewrite(outf); writeln('считаны числа из А'); while not eof(inf) do begin read(inf,i); write(i,' '); if i>0 then write(outf,i); end; close(inf); writeln; writeln('в файл В записаны числа'); reset(outf); while not eof(outf) do begin read(outf,i); write(i,' '); end; close(outf); end.