Decompose a number into a sum of repdigits
perl 5 - 97 92 93 86

$x=$_=pop;{printf"%15s
",$_;$_=$x,s!\d!//,$&amp;!eg,$x-=$_,$i++?s/^\b/+/:s/^/=/;/0/||redo}


Input given as a parameter:

$perl a.pl 2224192
     2224192
    =2222222
       +1111
        +888
         -22
          -7