whiplk

[CODE] - PotĂȘncia

Mar 16th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.17 KB | None | 0 0
  1. public class Matematica {
  2.     public long potencia(int n, int exp) {
  3.         long r = n;
  4.         for (int i = 0; i < exp - 1; i++) {
  5.             r *= n;
  6.         }
  7.         return r;
  8.     }
  9. }
  10.  
  11. //Willian Luigi
Advertisement
Add Comment
Please, Sign In to add comment