1 #include "stdio.h" 2 #include "iostream" 3 4 long fact(int n); 5 6 int main() 7 { 8 int i; 9 scanf("%d", &i); 10 printf("%d 的结成结果为: %ld ",i,fact(i)); 11 system("pause"); 12 return 0; 13 } 14 15 long fact(int n) 16 { 17 if (n <= 1) 18 return 1; 19 else 20 return n*fact(n - 1); 21 }