作业:将三个数按从大到小输出

作业:将三个数按从大到小输出,第1张

作业:将三个数按从大到小输出
#define _CRT_SECURE_NO_WARNINGS 1
//将三个数按从大到小输出
#include
int main()
{
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	if (a < b)
	{
		int tem = a;
		a = b;
		b = tem;
	}
	if (a < c)
	{
		int tem = a;
		a = c;
		c = tem;
	}
	if (b < c)
	{
		int tem = b;
		b = c;
		c = tem;
	}
	printf("%d %d %dn", a, b, c);
	return 0;
}

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5713375.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存