program ideone;
uses SysUtils;
const
FloatFmt10:String = '0.##########';
FloatFmt25:String = '0.#########################';
FloatNum:String = '***'; //тут символи замість яких буде виводитись число
function VarToString(format: string; const a: array of extended): string;
var i, j: integer;
s: string;
x: extended;
begin
s:=format;
for i := Low(a) to High(a) do
begin
j := Pos(FloatNum, s);
Delete(s, j, Length(FloatNum));
x := a[i];
if x>1e18 then
Insert(FloatToStrF(x, ffFixed, 50, 0), s, j)
else
if x<1e-10 then
Insert(FormatFloat(FloatFmt25, x), s, j)
else
Insert(FormatFloat(FloatFmt10, x), s, j)
end;
VarToString:=s;
end;
begin
(* your code goes here *)
writeln(VarToString('***',2e23));
writeln(VarToString('***',2e50));
end.
cHJvZ3JhbSBpZGVvbmU7CnVzZXMgU3lzVXRpbHM7CmNvbnN0CiAgICBGbG9hdEZtdDEwOlN0cmluZyA9ICcwLiMjIyMjIyMjIyMnOwogICAgRmxvYXRGbXQyNTpTdHJpbmcgPSAnMC4jIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjJzsKICAgIEZsb2F0TnVtOlN0cmluZyA9ICcqKionOyAvL9GC0YPRgiDRgdC40LzQstC+0LvQuCDQt9Cw0LzRltGB0YLRjCDRj9C60LjRhSDQsdGD0LTQtSDQstC40LLQvtC00LjRgtC40YHRjCDRh9C40YHQu9C+CmZ1bmN0aW9uIFZhclRvU3RyaW5nKGZvcm1hdDogc3RyaW5nOyBjb25zdCBhOiBhcnJheSBvZiBleHRlbmRlZCk6IHN0cmluZzsKdmFyIGksIGo6IGludGVnZXI7CiBzOiBzdHJpbmc7CiB4OiBleHRlbmRlZDsKYmVnaW4KICAgczo9Zm9ybWF0OwogICBmb3IgaSA6PSBMb3coYSkgdG8gSGlnaChhKSBkbwogICBiZWdpbgogICAgIGogOj0gUG9zKEZsb2F0TnVtLCBzKTsKICAgICBEZWxldGUocywgaiwgTGVuZ3RoKEZsb2F0TnVtKSk7CiAgICAgeCA6PSBhW2ldOwogICAgIGlmIHg+MWUxOCB0aGV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