Var
A:string;
C:array['0'..'9'] of integer;
i:integer;
Begin
Write('Введите натуральное число: ');ReadLn(A);
For i:= 1 to Length(A) do
if ('0'<=A[i])and(A[i]<='9') then<br> C[A[i]]:=C[A[i]]+1;
For i:= 1 to C['9'] do
Write('9 ');
For i:= 1 to C['6'] do
Write('6 ');
For i:= 1 to C['3'] do
Write('3 ');
WriteLn;
For i:= 1 to C['0'] do
Write('0 ');
For i:= 1 to C['2'] do
Write('2 ');
For i:= 1 to C['4'] do
Write('4 ');
For i:= 1 to C['6'] do
Write('6 ');
For i:= 1 to C['8'] do
Write('8 ');
End.
Введите натуральное число: 59012549703651409725190351902745210974651094251087498015794801574801974850197423
9 9 9 9 9 9 9 9 9 9 9 6 6 3 3 3
0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4 6 6 8 8 8 8 8