Уж извольте, на быструю руку набросал, можете попробывать
Код:
procedure Sort( var AResult:array of Double);
var
j: Integer;
tmp : Double;
begin
for j :=Low(AResult) to High(AResult) - 1 do
if AResult[j] > AResult[j+1] Then
begin
tmp := AResult[j];
AResult[j] := AResult[j+1];
AResult[j+1] := tmp;
end;
end;
procedure Find(const AArray: array of Double; AFileName:String);
var
Result: array [0..2] of Double;
ind :Integer;
f: Textfile;
begin
Result[0] := 0; Result[1] := 0; Result[2] := 0;
for ind:= Low(AArray) to High(AArray) do
begin
if AArray[ind] > Result[0] Then
begin
Result[0] := AArray[ind];
Sort(Result);
end;
end;
AssignFile(f, AFileName); {Assigns the Filename}
ReWrite(f); {Create a new file named ek.txt}
for ind:= Low(Result) to High(Result) do
Writeln(f, Format('%8.3f', [Result[ind]]));
Closefile(f); {Closes file F}
end;
Админ: Не забываем про теги!!
...
Find(In_Data, 'c:\1.txt'); // Найти и сохранить
...