Skip to content

Latest commit

 

History

History
31 lines (29 loc) · 339 Bytes

5.md

File metadata and controls

31 lines (29 loc) · 339 Bytes

题目:输入三个整数x,y,z,把这三个数由小到大输出。

#include<stdio.h>

int main()
{
	int x, y, z, t;
	scanf("%d%d%d", &x, &y, &z);
	if (x > y)
	{
		t = x;
		x = y;
		y = t;
	}
	if (x > z)
	{
		t = x;
		x = z;
		z = t;
	}
	if (y > z)
	{
		t = y;
		y = z;
		z = t;
	}
	printf("%d %d %d", x, y, z);

	return 0;
}