要求出最大值和最小值的差,麻烦看下我的哪里错了
#include <stdio.h>int main()
{
int a;
int b;
int c;
int d;
int e;
int f;
int result;
printf("please enter three integers\n");
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &c);
if(a > b)
{
d = a;
e = b;
}
else
{
d = b;
e = a;
}
if(c > d)
{
result = c - e;
}
else
{
f = c;
}
if(e > f)
{
result = d - f;
}
else
{
result = d - e;
}
printf("result = %d", result);
return 0;
}