三个数按顺序输出

三个数按顺序输出

#include<stdio.h>
    void max(int *a,int *b,int *c){
        int temp;
        if(*a<*b){
            temp=*a;
            *a=*b;
            *b=temp;
        }
        if(*a<*c){
            temp=*a;
            *a=*c;
            *c=temp;
        }
         if(*b<*c){
            temp=*b;
            *b=*c;
            *c=temp;
        }
}
int main(){
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    int *p1=&a,*p2=&b,*p3=&c;
    max(p1,p2,p3);
    printf("%d %d %d\n",*p1,*p2,*p3);
}