#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
int a, b, c, d;
printf("请输入四个数:");
scanf("%d%d%d%d", &a, &b, &c, &d);
int t;
if(a>b)
{
t = a;
a = b;
b = t;
}
if(a>c)
{
t = a;
a = c;
c = t;
}
if(a>d)
{
t = a;
a = d;
d = t;
}
if(b>c)
{
t = b;
b = c;
c = t;
}
if(c>d)
{
t = c;
c = d;
d = t;
}
printf("%d %d %d %d\n", a, b, c, d);
return 0;
}
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交