//第九章指针问题,全部都用指针来实现
#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
//输入三个数,按由小到大的顺序输出
int a,b,c,x;
int *p,*q,*t;
printf("请输入三个整数:\n");
scanf("%d %d %d",&a,&b,&c);
p=&a;q=&b;t=&c;
if(*p>*q) //由小到大输出
{
x=*p;
*p=*q;
*q=x;
}
if(*p>*t)
{
x=*p;
*p=*t;
*t=x;
}
if(*q>*t)
{
x=*q;
*q=*t;
*t=x;
}
printf("输出排序好的数是%d\t%d\t%d\n",a,b,c);
return 0;
}