fork download
  1. import java.lang.*;
  2.  
  3. class Calculadora {
  4. public static int power(int n, int p) {
  5. if (n < 0 || p < 0) throw new IllegalArgumentException("n ou p");
  6. return (int)Math.pow(n, p);
  7. }
  8. public static void main(String[] args) {
  9. System.out.println(power(10, 2));
  10. }
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/118292/101
Success #stdin #stdout 0.07s 32352KB
stdin
Standard input is empty
stdout
100