Created
November 2, 2014 15:40
-
-
Save Cee/42341c228c9a44eb133b to your computer and use it in GitHub Desktop.
Power
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int pow(int n, int k) { | |
if (k == 0) return 1; | |
if (k == 1) return n; | |
return n * pow(n, k - 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment