# define _CRT_SECURE_NO_WARNINGS
# include<stdio.h>
/*
2024年5月7日15:53:42
三个数的排序
*/
int main()
{
int a, b, c; //等价于int a; int b; int c;
int t;
printf("请输入三个整数,中间以空格分隔:");
scanf("%d %d %d", &a, &b, &c);
if (a < b)
{
t = a;
a = b;
b = t;
}
if (a < c)
{
t = a;
a = c;
c = t;
}
if (b < c)
{
t = b;
b = c;
c = t;
}
printf("%d %d %d ", a, b, c);
return 0;
}
C语言---对任意三个数字从大到小排序
最新推荐文章于 2024-07-19 19:11:19 发布