找出错误原因在傍边指出

main()
{ int x,y;
printf("%d\n",sum(x+y));
int sum(a,b);
{ int a,b;
return(a+b);
}
}

指出错误原因,

sum(x+y),sum需要2个参数,这里之传入了1个参数

sum中的int a,b重复声明了a和b,这行多余,删了。

main()
{ int x,y;
printf("%d\n",sum(x,y)); // 传参
int sum(int a,int b) // 函数
{ int a,b;
return(a+b);
}
}