Rotating digits of Integer in Perl -
in perl, how rotate digits of integer? here sample inputs , outputs
sample input
12345 10901
sample output
51234 11090
$x = chop($x) . $x;
or
$x = substr("$x$x",length($x)-1,length($x))
in perl, how rotate digits of integer? here sample inputs , outputs
12345 10901
51234 11090
$x = chop($x) . $x;
or
$x = substr("$x$x",length($x)-1,length($x))
Comments
Post a Comment