#include <stdio.h>
int main()
{
int a, b, c, d;
printf("请输入a,b,c的值:\n");
scanf("%d%d%d",&a,&b,&c);
if(a>=b)
{
d = a;
a = b;
b = d;
}
else if(b>=c)
{
d = b;
b = c;
c = d;
}
printf("从小到大:\n");
printf("%d %d %d\n",a,b,c);
d=a;
a=c;
c=d;
printf("从大到小:\n");
printf("%d %d %d\n",a,b,c);
return 0;
}
int main()
{
int a, b, c, d;
printf("请输入a,b,c的值:\n");
scanf("%d%d%d",&a,&b,&c);
if(a>=b)
{
d = a;
a = b;
b = d;
}
else if(b>=c)
{
d = b;
b = c;
c = d;
}
printf("从小到大:\n");
printf("%d %d %d\n",a,b,c);
d=a;
a=c;
c=d;
printf("从大到小:\n");
printf("%d %d %d\n",a,b,c);
return 0;
}