n!怎么编写啊~~~写了半天都没写出来
求解!!
程序代码:
#include <stdio.h> int main (void) { int n; long int jc (int n); printf ("Enter a digit:"); scanf ("%i",&n); printf ("%i! is %i\n",n,jc(n)); return 0; } long int jc (int n) { long int result; if(n==0) { return result=1; }else { return result=n*jc(n-1); } }