error: ‘f’ cannot be used as a function y=f(n); 求解
#include <stdio.h>long f(int n)
{
long p;
if(n==0||n==1)
p=1;
else p=f(n-1)*n;
return p;
}
int main(void)
{
int n;
long y,f(n);
printf("please input a number:");
scanf("%d",&n);
while(n<0)
{
printf("error,input again:");
scanf("%d",&n);
}
y=f(n);
printf("%d!=%ld\n",n,y);
return 0;
}