uses crt;
const FILE_NAME='c:\inFile.dat';
TMP_FILE_NAME='c:\tmp.dat';
var f,a:file of real;
f_min,f_tmp:real;
begin
f_min:=-2.9e-39;
assign(f,FILE_NAME);
reset(f);
while not eof(f) do
begin
read(f,f_tmp);
if t_tmp<f_min then f_min:=f_tmp;
end;
assign(a,TMP_FILE_NAME);
rewrite(a);
reset(f);
while not eof(f) do
begin
read(f,f_tmp);
if f_tmp<0 then f_tmp:=f_min;
write(a,f_tmp);
end;
close(f);
erase(f);
rename(a,FILE_NAME);
close(a);
end.
uses crt;
const FILE_NAME='c:\inFile.dat';
TMP_FILE_NAME='c:\tmp.dat';
var f,a:file of real;
f_min,f_tmp:real;
begin
f_min:=-2.9e-39;
assign(f,FILE_NAME);
reset(f);
while not eof(f) do
begin
read(f,f_tmp);
if t_tmp<f_min then f_min:=f_tmp;
end;
assign(a,TMP_FILE_NAME);
rewrite(a);
reset(f);
while not eof(f) do
begin
read(f,f_tmp);
if f_tmp<0 then f_tmp:=f_min;
write(a,f_tmp);
end;
close(f);
erase(f);
rename(a,FILE_NAME);
close(a);
end.