源程序:
#include <stdio.h>
void order(int *x1,int *x2)
{
int t;
if(*x1>*x2)
{
t=*x1;
*x1=*x2;
*x2=t;
}
}
void main()
{
int x,y;
printf("请输入x,y的值:");
scanf("%d%d",&x,&y);
printf("x=%d,y=%d
",x,y);
order(&x,&y);
printf("x=%d,y=%d
",x,y);
}