#include <stdio.h>
int jc(int n){
int result;
if(n < 0){
printf("输入错误\n");
return 0;
}else if(0 == n || 1 == n){
result 1;
}else {
result = jc(n-1)*n;
}
return result;
}
int main (){
int n = 5;
printf("阶乘结果: %d\n",n,jc(n));
return 0;
}
qq_半夏流年_0
相关分类