|
// 三个数按照从小到大的顺序排序
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int t,x,y,z;
printf ("please input three numbers:\n");
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);
system("pause");
return 0;
}
|
|