<span style="font-size:18px;">#include<stdio.h>
void temp(int *m,int *n)//交换的是指定地址中存储的值
{
int t;
t=*m;
*m=*n;
*n=t;
}
void main()
{
int a,b,c;
int *p,*q,*w;
p=&a;
q=&b;
w=&c;
scanf("%d%d%d",p,q,w);
if(a>b)
temp(p,q);
if(a>c)
temp(p,w);
if(b>c)
temp(q,w);
printf("%4d%4d%4d\n",a,b,c);</span>原文地址:http://blog.csdn.net/zxx150633/article/details/38708595