void fact(int value)
{ int f;
if(value<0);
{ printf(“Arg error\n");
return(-1); }
else if(value==1||value==0) f=1;
else f=value*fact(value-1)+1;
printf(“This called value=%d\n”,f);
return f;
}
void main()
{ printf(“main( ) :%d\n”,fact(5));
fact(-5); }
慕斯709654
相关分类