fork download
  1. #include<stdio.h>
  2. void main()
  3. {
  4. void exchange(int *q1,int *q2,int *q3);
  5. int a,b,c,*p1,*p2,*p3;
  6. scanf("%d,%d,%d",&a,&b,&c);
  7. p1=&a;p2=&b;p3=&c;
  8. exchange(p1,p2,p3);
  9. printf("\n%d,%d,%d\n",a,b,c);
  10. }
  11. void exchange(int *q1,int *q2,int *q3)
  12. {
  13. void swap(int *pt1,int *pt2);
  14. if(*q1<*q2)swap(q1,q2);
  15. if(*q1<*q3)swap(q1,q3);
  16. if(*q2<*q3)swap(q2,q3);
  17. }
  18. void swap(int *pt1,int *pt2)
  19. {
  20. int temp;
  21. temp=*pt1;
  22. *pt1=*pt2;
  23. *pt2=temp;
  24. }
Success #stdin #stdout 0.01s 5308KB
stdin
9,0,10
stdout
32767,9,-1166127824