declaration terminated incorrectly

来源:百度知道 编辑:UC知道 时间:2024/05/10 06:50:24
我是初学者。。。哪位高手帮帮我~~
#include <stdio. h>
void main()
{
int max(int x,int y,int z);
int a,b,c,d;
scanf("%d,%d,%d",&a,&b,&c);
c=max(a,b,c);
printf("max=%d\n",d));
}
int max(int x;int y;int z);
{ /* declaration terminated incorrectly 为什么这样? */
int w,v;
if (x>y) v=x;
else v=y;
if (v>z) w=v;
else w=z;
return(w);
}

语法错误,仔细些,多看看书。
#include <stdio. h>
void main()
{
int max(int x,int y,int z);/*函数声明不能在函数内部*/
int a,b,c,d;
scanf("%d,%d,%d",&a,&b,&c);
c=max(a,b,c);/*应该是d = max(a, b, c);吧*/
printf("max=%d\n",d));
}
int max(int x;int y;int z);/*实参要以逗号分隔,函数定义不要加分号*/
{ /* declaration terminated incorrectly 为什么这样? */
int w,v;
if (x>y) v=x;
else v=y;
if (v>z) w=v;
else w=z;
return(w);
}