// PascalABC.NET 3.2, сборка 1467 от 02.06.2017 // Внимание! Если программа не работает, обновите версию!
begin var s:=ReadlnString('>'); var k:=s.Length mod 4; if k>0 then s:=(4-k)*'0'+s; var a:=s.Batch(4).Select(c->c.JoinIntoString('')); foreach var t in a do case t of '0000':Write('0'); '0001':Write('1'); '0010':Write('2'); '0011':Write('3'); '0100':Write('4'); '0101':Write('5'); '0110':Write('6'); '0111':Write('7'); '1000':Write('8'); '1001':Write('9'); '1010':Write('A'); '1011':Write('B'); '1100':Write('C'); '1101':Write('D'); '1110':Write('E'); '1111':Write('F'); end; Writeln end.
Пример > 110101111010101100010101110101101011011011 35EAC575ADB
// Внимание! Если программа не работает, обновите версию!
begin
var s:=ReadlnString('>');
var k:=s.Length mod 4;
if k>0 then s:=(4-k)*'0'+s;
var a:=s.Batch(4).Select(c->c.JoinIntoString(''));
foreach var t in a do
case t of
'0000':Write('0');
'0001':Write('1');
'0010':Write('2');
'0011':Write('3');
'0100':Write('4');
'0101':Write('5');
'0110':Write('6');
'0111':Write('7');
'1000':Write('8');
'1001':Write('9');
'1010':Write('A');
'1011':Write('B');
'1100':Write('C');
'1101':Write('D');
'1110':Write('E');
'1111':Write('F');
end;
Writeln
end.
Пример
> 110101111010101100010101110101101011011011
35EAC575ADB