Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.58 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. $szam1=<>;
  4. chomp($szam1);
  5. $szam2=<>;
  6. chomp($szam2);
  7. $szam3=<>;
  8. chomp($szam3);
  9. my @tomb;
  10.  
  11. if($szam2 <= $szam3)
  12. {
  13.         for($i=$szam2; $i<=$szam3; $i++)
  14.         {
  15.                 push (@tomb, $i);
  16.         }
  17. }
  18. else
  19. {
  20.         for($i=$szam3; $i<=$szam2; $i++)
  21.         {
  22.                 push (@tomb, $i);
  23.         }
  24. }
  25.  
  26. for($j=0; $j<=$#tomb; $j++)
  27. {
  28.         if($tomb[$j] <= 9 && $tomb[$j] > -10)
  29.         {
  30.                 print "$tomb[$j]"-"$szam1"."\n";
  31.         }
  32.         else
  33.         {
  34.                 print "$tomb[$j]"+"$szam1"."\n";
  35.         }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement