# include "stdio.h" long fac(int n) { long f; if(n==0) return(1); f=fac(n-1)*n; return(f); } int main(void) { int x; printf("请输入x:"); scanf("%d",&x); printf("%d的阶乘为%ld\n",x,fac(x)); }