输出几个数逆顺序输出

来源:互联网 发布:折扣软件哪个好 编辑:程序博客网 时间:2024/05/22 00:06
#include <stdio.h>#include <stdlib.h>int main(){    int a,b,c,*p1,*p2,*p3;    scanf("%d%d%d",&a,&b,&c);    p1=&a;    p2=&b;    p3=&c;    exchange(p1,p2,p3);    printf("%d%d%d\n",a,b,c);    return 0;}void swap(int *x,int *y){    int temp;    if(*x<*y)    {        temp=*x;        *x=*y;        *y=temp;    }}void exchange(p1,p2,p3){    swap(p1,p2);    swap(p1,p3);    swap(p2,p3);}