作业帮 > 综合 > 作业

C语言求解werwerwe.cpp(6) : see declaration of 'high

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/05/27 03:31:32
C语言求解werwerwe.cpp(6) : see declaration of 'high
#include
#include
int main()
{
\x09int a,b,c,d;
\x09int high(int,int);
\x09scanf("%d%d%d%d",&a,&b,&c,&d);
\x09int high(a,b);
\x09int high(a,c);
\x09int high(a,d);
\x09int high(b,c);
\x09int high(b,d);
\x09int high(c,d);
\x09printf("%d,%d,%d,%d\n",a,b,c,d);
\x09return 0;
}
int high(int x,int y)
{
\x09int max;
\x09if (y>x)
\x09{
\x09\x09max=y;
\x09\x09y=x;
\x09\x09x=max;
\x09}
\x09return 0;
}
C语言求解werwerwe.cpp(6) : see declaration of 'high
调用函数不能加上返回类型
high(a,b);
high(a,c);
这样才对.
另外,你这个函数是交换两个数吧?把大数放在后面?
你这样是交换不成功的,在函数声明里面这样写就行了int high(int&,int&);