c语言 自定义函数,1到10的阶乘,怎么写啊

来源:学生作业帮助网 编辑:作业帮 时间:2024/03/29 23:09:54
c语言 自定义函数,1到10的阶乘,怎么写啊

c语言 自定义函数,1到10的阶乘,怎么写啊
c语言 自定义函数,1到10的阶乘,怎么写啊

c语言 自定义函数,1到10的阶乘,怎么写啊
#include "stdio.h"
int jiecheng(int n)
{
if(n==1)
return 1;
else return n*jiecheng(n-1);
}
int main()
{
printf("10的阶乘为 %d ",jiecheng(10));
return 0;
}

你要求1到10的阶乘之和吧?