INT computeXn(int X, int N){if(n == 2){RETURN x*x;}ELSE if(n % 2 == 0){int y = computeXn(x, n/2);return y*y;}else if(n % 2 == 1){int y = computeXn(x, n/2);return y*y*x;}}
int computeXn(int x, int n){if(n == 2){return x*x;}else if(n % 2 == 0){int y = computeXn(x, n/2);return y*y;}else if(n % 2 == 1){int y = computeXn(x, n/2);return y*y*x;}}
Your experience on this site will be improved by allowing cookies. Read Cookie Policy