SHARE
TWEET

Untitled

ipsavitsky234 Nov 18th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {процедура "красивого" вывода числа(с обработкой '.' и '-')}
  2. procedure Print_number(x: arr_int);
  3. var
  4.     i, shift, first: integer;
  5. begin
  6.     shift := 0;
  7.     first := 0;
  8.     while (x.data[first] = 0) and (first < x.point-1) do inc(first);
  9.     {writeln('first = ', first);}
  10.     {if x.point <> 0 then inc(x.len);}
  11.     if x.is_negative then write('-');
  12.     for i := first to x.len do
  13.         if i = x.point then
  14.         begin
  15.             if i = first then write(0);
  16.             write('.');
  17.             shift := 1;
  18.         end
  19.         else if x.data[i-shift] >= 10 then write(chr(x.data[i-shift] + ord('A') - 10))
  20.                                  else write(chr(x.data[i-shift] + ord('0')));
  21.     {if x.point <> 0 then inc(x.len, -1);}
  22.     {write('(point = ', x.point, '; len = ', x.len, ')');}
  23.     writeln;
  24. end;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top