#include <stdio.h>
int fun(int x, int n) {
int result;
if (n == 1)
return x;
else {
result = x + fun(x, n - 1);
printf("result = %d, n = %d\n", result, n);
return result;
}
}
int main()
{
printf("y=%d",fun(4,5));
}
为什么result的值不固定,正常情况下怎么会求出x+fun(x,n-1)的值