//变量定义你自己改下 int fun(int x,int n) { if(n==0)return 1; else if(n>0) return fun(x,int n-1)*x; else if(n<0) return fun(x,n+1)/n; }