Codeforces 723A

#include <stdio.h>

#define max(x, y, z) (x>y?x>z?x:z:y>z?y:z)
#define min(x, y, z) (x<y?x<z?x:z:y<z?y:z)

int main()
{
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	int left=min(a, b, c);
	int right=max(a, b, c);
	printf("%d\n", right-left);
	return 0;
}
 

  @对输入的三个数,找出其中的最大值和最小值,用最大值减去最小值,所得结果即为Answer。

猜你喜欢

转载自www.cnblogs.com/commario/p/11836401.html