注册 登录
编程论坛 C语言论坛

请各位大神帮我看看哪里错了

可爱的蓝精灵 发布于 2019-07-08 20:17, 1796 次点击
#include<stdio.h>
int main()
{
    int max(int x,int y);
    int a,b,c;
    scanf("%d,%d,&a,&b);
    c=max(a,b);
    printf("max=%d\n",c);
        return 0;
}
int max(int x,int y)
{
    int z;
    if(x>y)z=x;
    else z=y;
    return(z);
}
C:\Users\20305\Desktop\new.cpp(6) : error C2001: newline in constant
C:\Users\20305\Desktop\new.cpp(7) : error C2146: syntax error : missing ')' before identifier 'c'
执行 cl.exe 时出错.

new.obj - 1 error(s), 0 warning(s)
2 回复
#2
xlf2586894962019-07-08 20:41
回复 楼主 可爱的蓝精灵
c=max那里错了定义不对
#3
可爱的蓝精灵2019-07-08 20:49
谢谢了,我知道哪错了,scanf("%d,%d",&a,&b);我少了"
1