program Project3;
{$APPTYPE CONSOLE}
{$R *.res}
uses
SysUtils;
// Von HolgerXs Delphi 6
function HexToBin(Text, Buffer: PChar; BufSize: Integer): Integer;
assembler;
const
Convert:
array['
0'..'
f']
of SmallInt =
( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,
-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,10,11,12,13,14,15);
var
I: Integer;
begin
I := BufSize;
while I > 0
do
begin
if not (Text[0]
in ['
0'..'
f'])
or not (Text[1]
in ['
0'..'
f'])
then Break;
Buffer[0] := Char((Convert[Text[0]]
shl 4) + Convert[Text[1]]);
Inc(Buffer);
Inc(Text, 2);
Dec(I);
end;
Result := BufSize - I;
end;
procedure Main;
var
S:
string;
B:
string;
begin
S := '
0056006F007200730063006800610075';
S := LowerCase(S);
SetLength(B, Length(S)
div 2);
HexToBin(PChar(S), @B[1], Length(B));
S := StringReplace(B, #0, '
', [rfReplaceAll, rfIgnoreCase]);
Writeln(S);
end;
begin
try
Main;
Readln;
except
on E:
Exception do
Writeln(E.ClassName, '
: ', E.
Message);
end;
end.