#include<stdio.h> int fact(int n); void main(){ int i; printf("input:"); scanf("%d",&i); printf("%d的阶乘结果为:%d",i,fact(i)); getch(); } int fact(int n){ if(n<=1) return 1; else return fact(n-1)*n; }
原文地址:http://blog.csdn.net/u013289188/article/details/41750857