Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;use warnings;
- my $min_num=100000;
- for (my $i=$min_num;;$i++) {
- next if ($i % 10 == 0); # otherwise will print also if $s starts with 0.
- my $s=reverse($i);
- my $sum=$i+$s;
- if ($sum eq reverse($sum)) {
- print "$i+$s=$sum\n";
- }
- }
Add Comment
Please, Sign In to add comment