Advertisement
hackloper775

numeros-perl

Feb 8th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.35 KB | None | 0 0
  1. #!/usr/bin/env perl
  2.  
  3. print "Escribe un numero de 0/4 : ";
  4.  
  5. my $n = <STDIN>;
  6.  
  7. if ( $n == 0 ){
  8.  
  9. print "Es cero\n";
  10.  
  11. } elsif ( $n == 1 ) {
  12.  
  13. print "Es uno \n";
  14.  
  15. } elsif ( $n == 2 ) {
  16.  
  17. print "Es dos \n";
  18.  
  19. } elsif ( $n == 3 ) {
  20.  
  21. print "Es tres\n";
  22.  
  23. } elsif ( $n == 4 ) {
  24.  
  25. print "Es cuatro\n";
  26.  
  27. } else {
  28.  
  29. print "Entre 1 y 4\n";
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement