Guest User

Untitled

a guest
Dec 15th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1.  
  2. use strict;use warnings;
  3. my $min_num=100000;
  4. for (my $i=$min_num;;$i++) {
  5. next if ($i % 10 == 0); # otherwise will print also if $s starts with 0.
  6. my $s=reverse($i);
  7. my $sum=$i+$s;
  8. if ($sum eq reverse($sum)) {
  9. print "$i+$s=$sum\n";
  10. }
  11. }
Add Comment
Please, Sign In to add comment