#include<stdio.h>
int main (void)
{
int result= abc(6) ;
printf("the number is %d\n",result);
return 0;
}
void abc (int x)
{
if (x == 0)
return 1;
else
{
int recurse = abc(x-1);
int result = n*recurse;
return result;
}
}
错在哪呢?
#include<stdio.h>
int main (void)
{
int abc (int x);
int result= abc(6) ;
printf("the number is %d\n",result);
getchar();
return 0;
}
int abc (int x)
{
if (x == 0)
{
return 1;
}
else
{
int recurse = abc(x-1);
int result = x*recurse;
return result;
}
}
#include<stdio.h>
int main (void)
{
int abc (int x); //你们都不用声明的吗???
int result= abc(6);
printf("the number is %d\n",result);
return 0;
}
int abc (int x)
{
static int result =0;
if (x == 0)
return 1;
else
result = x*abc(x-1);
return result;
}