int main()
{
int a,b,c;
scanf("%d %d", &a &b);
if(a<b)
{
a=c;
b=a;
c=b;
}
printf("max=%d",a);
return 0;
}
报错 [Error] invalid operands of types 'int*' and 'int' to binary 'operator&'(scanf)那行
int main()
{
int a,b,c;
scanf("%d %d", &a &b);
if(a<b)
{
a=c;
b=a;
c=b;
}
printf("max=%d",a);
return 0;
}
报错 [Error] invalid operands of types 'int*' and 'int' to binary 'operator&'(scanf)那行
收起
scanf("%d %d", &a &b); &a &b 间漏了','逗号,修改为: scanf("%d %d", &a, &b); ,下面两数交换也有问题,修改如下:
int main()
{
int a, b, c;
scanf("%d %d", &a, & b);//修改
if (a < b)
{
c = a;//a = c;修改
a = b;//b = a;修改
b = c;//c = b;修改
}
printf("max=%d", a);
return 0;
}
报告相同问题?