Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program q172933272;
- {$APPTYPE CONSOLE}
- uses
- SysUtils;
- function Hex2BinDigit(aValue: char): string;
- begin
- case aValue of
- '0': Result := '0000';
- '1': Result := '0001';
- '2': Result := '0010';
- '3': Result := '0011';
- '4': Result := '0100';
- '5': Result := '0101';
- '6': Result := '0110';
- '7': Result := '0111';
- '8': Result := '1000';
- '9': Result := '1001';
- 'A': Result := '1010';
- 'B': Result := '1011';
- 'C': Result := '1100';
- 'D': Result := '1101';
- 'E': Result := '1110';
- 'F': Result := '1111';
- end;
- end;
- function Trim(aValue: string): string;
- begin
- while (aValue[1] = '0') do
- begin
- Delete(aValue, 1, 1);
- if (Length(aValue) = 1) then
- break;
- end;
- Result := aValue;
- end;
- function Hex2Bin(aValue: string): string;
- var
- i: Cardinal;
- begin
- Result := '';
- for i := 1 to Length(aValue) do
- Result := Result + Hex2BinDigit(UpCase(aValue[i]));
- Result := Trim(Result);
- end;
- var
- value: string;
- begin
- readln(value);
- //value := '1E0E4E8EE20EEE5EB20F0F22CF220F1FCE4E5EEEDE2FB20E8EC2049202074652ED2E120E0EEE2E1F0F220CAF1EFE4E5E6EE204154E8ECEDECECF2E5205720FBEEEE6B6F436E650D696573654963020A65746567740D054D6D05656F046574AF036F0205697403014869680300466E2E687265074446555443415354466E2E6F6F0763576E6F54780B6F7448696802096F744E6D0654686D0A6F745379650050726E466E0853726C42720773567';
- writeln(Hex2Bin(value));
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment