报错记录 类型未定义警告

报错记录 类型未定义警告
type of ‘n’ defaults to ‘int’ [-Wimplicit-int]#includestdio.h #includestring.h int fun(int n) { //第一层5*fun(4) //第二层4*fun(3) //第三层3*fun(2) //第四层2*fun(1) //第五层return 1 if(n1) { return 1; } else if(n1) { return n*fun(n-1); } } int main(int argc, char const *argv[]) { //函数递归 int nfun(5); printf(%d\n,n); return 0; }原因int fun(n)函数参数类型没有加类型定义应该是int fun(int n)