C语言递归工厂不起作用

问题描述

对于下面的代码,我没有任何反应,我将其限制为无条件,例如,人们会选择正数。除了Process returned -1073741571 (0xC00000FD) execution time : 3.194 s之外,我没有任何回应。如果输入5,答案应该是120,而不是这里。

#include <stdio.h>
#include <stdlib.h>

int faktorijel(int x){

        return (x*faktorijel(x-1));

}
main (){

int a,b ;
printf("Type in a number:");
scanf("%d\n",&a);
b=faktorijel(a);
printf("Result is %d\n",b);
return 0;

}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)