public static int ABC(int x, int y)
{
if(y==0)
ret开发者_运维知识库urn(1);
else
return(x * ABC(x,y-1));
}
what this function do please ? factorial ?
The x
is never changed and multiplied to the 1 exactly y
times, as y is decremented in each recursive call until it is 0. So the function computes x^y
in a recursive way.
Looks like x ^ y
精彩评论