program Reverse; var hexValue, x, r: Int64; //*********************************************************************** //Не знаю как с этим компилятором вывести hex //для вывода эта функция function IntToHex(Value: Int64): string; var pos:integer; HexChars:string; Result:string; begin Result:=''; while Value>0 do begin HexChars := '0123456789ABCDEF'; pos:=Value mod $10; Result := HexChars[pos + 1] + Result; Value:=Value div $10; end; IntToHex:= Result; end; //************************************************************************ // программа реверс begin hexValue := $2300FFC0;// Оставим исходное число для вывода, по желанию x:= hexValue; r := 0; while x > 0 do begin r := r * $100 + (x mod $100); // остаток от деления прибавляем к перевертышу x := x div $100; end; writeln('hexValue ',IntToHex(hexValue)); writeln('Reverse ',IntToHex(r)); end.
Write, Run & Share Pascal code online using OneCompiler's Pascal online compiler for free. It's one of the robust, feature-rich online compilers for Pascal language. Getting started with the OneCompiler's Pascal editor is easy and fast. The editor shows sample boilerplate code when you choose language as Pascal and start coding.