[求助]菜问题||C语言学习第三天
这是比较三个数的大小,编译的时候出现错误:Undefined symbol 'max' in function main
Undefined symbol 'min' in function main
void main(){
int a,b,c,max,min;
printf("input three numbers: ");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{max=a;min=b;} /*错误行*/
else
{max=b;min=a;}
if(max<c)
max=c;
else
if(min>c)
min=c;
printf("max=%d\nmin=%d",max,min);
}
看报错的意思, max,min要在主函数中?
肯请各位高手帮忙