#include <stdio.h>
int f(int a)
{
if(a==1||a==0)
return 1;
else if(a>1)
return a*f(a-1);
else
return -1;
}
int main (void)
{
printf("%d\n",f(5));
return 0;
}
2023-11-27 21:40:10
#include <stdio.h>
int f(int a)
{
if(a==1||a==0)
return 1;
else if(a>1)
return a*f(a-1);
else
return -1;
}
int main (void)
{
printf("%d\n",f(5));
return 0;
}
下一篇:else语句