编程error C2181: 没有匹配 if 的非法 else 是什么意思?
#include<stdio.h>intmain(){floatX;floatY;floatZ;floatmin;printf("X=");scanf("%f",X);p...
#include<stdio.h>
int main()
{
float X;
float Y;
float Z;
float min;
printf("X=");
scanf("%f", X);
printf("Y=");
scanf("%f", Y);
printf("Z=");
scanf("%f", Z);
if (X>Y);
{
int min = Y;
}
else if(Y>X)
{
int min = X;
}
if(min>Z);
{
int min = Z;
}
else if(Z>min)
{
int min = min;
}
printf("The smallest number is ");
printf("%.2f\n", min);
return 0;
} 展开
int main()
{
float X;
float Y;
float Z;
float min;
printf("X=");
scanf("%f", X);
printf("Y=");
scanf("%f", Y);
printf("Z=");
scanf("%f", Z);
if (X>Y);
{
int min = Y;
}
else if(Y>X)
{
int min = X;
}
if(min>Z);
{
int min = Z;
}
else if(Z>min)
{
int min = min;
}
printf("The smallest number is ");
printf("%.2f\n", min);
return 0;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询