用指针完成对输入三个数从大到小顺序排列请大神看看我的程序为什么运行不了?
#include<stdio.h>void main()
{
int x,y,z;
int *px,*py,*pz;
printf("Input:\n");
scanf("%d%d%d",&x,&y,&z);
px=&x;
py=&y;
pz=&z;
if(px>py>pz)
{
printf("*px=%d",*px);
printf("*py=%d",*py);
printf("*pz=%d",*pz);
}
if(py>px>pz)
{
printf("*py=%d",*py);
printf("*px=%d",*px);
printf("*pz=%d",*pz);
}
if(pz>py>px)
{
printf("*pz=%d",*pz);
printf("*py=%d",*py);
printf("*px=%d",*px);
}
if(px>pz>py)
{
printf("*px=%d",*px);
printf("*pz=%d",*pz);
printf("*py=%d",*py);
}
if(py>pz>px)
{
printf("*py=%d",*py);
printf("*pz=%d",*pz);
printf("*px=%d",*px);
}
if(pz>px>py)
{
printf("*pz=%d",*pz);
printf("*px=%d",*px);
printf("*py=%d",*py);
}
}