文章标题

来源:互联网 发布:网络主播签约注意事项 编辑:程序博客网 时间:2024/06/16 18:26
#include<stdio.h>void exchange(int *p1,int *p2,int *p3);void swap(int *x,int *y) {    int temp;   if(*x<*y){        temp = *x;        *x = *y;        *y = temp;        }}int main(){     int a,b,c;     int *p1,*p2,*p3;     p1=&a;     p2=&b;     p3=&c;     scanf("%d%d%d",&a,&b,&c);     exchange(p1,p2,p3);     printf("%d %d %d\n",a,b,c);     return 0;}void exchange(int *p_1,int *p_2,int *p_3);{    swap(p_1,p_2);    swap(p_1,p_3);    swap(p_2,p_3);}
原创粉丝点击