#include<stdio.h>
int main()
{ int a,b,c;
int compare(int *x,int *y);
printf("请输入a,b,c三个数:\n");
scanf("%d%d%d",&a,&b,&c);
compare(&a,&b);
compare(&a,&c);
compare(&b,&c);
printf("a,b,c由大到小顺序为:%d %d %d\n",a,b,c);
return 0;
}
int compare(int *x,int *y)
{ int z;
if(*x<*y)
z=*x;
*x=*y;
*y=z;
}
本文出自 “零点时光” 博客,请务必保留此出处http://10741764.blog.51cto.com/10731764/1699040