【求助】[Error] 'else' without a previous 'if'
题目描述已知有两个整数,请使用if-else选择结构将它们中的较大数选择出来,存到max变量中;将较小数选择出来,存到min变量中,并将选择结果输出。
#include<stdio.h>
int main()
{
int a,b,max,min=0;
scanf("%d%d",&a,&b);
if(a=b){max=a;min=b;}
printf("The two numbers are equal.");
else if(a>b){max=a;min=b;}
else if(a<b){max=b;min=a;}
printf("The larger number is %d, the smaller number is %d.",max,min);
return 0;
}
错误: [Error] 'else' without a previous 'if'
[此贴子已经被作者于2019-10-6 13:19编辑过]