daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Apr 3rd, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  sub excepcionNegativo(Real $x) {
  2.      die "negative" if $x < 0;
  3.      $x.sqrt;
  4.  }
  5.  
  6.  for 5, -3 -> $n {
  7.      say "La raiz cuadrada del numero $n es: ", excepcionNegativo($n);
  8.  
  9.      CATCH {
  10.          when 'negative' {
  11.              say "No se puede calcular raiz cuadrada del numero $n"
  12.          }
  13.          default {
  14.              say "Hola";
  15.          }
  16.      }
  17.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top