fork download
  1. #include <stdio.h>
  2. void sort(int*x,int*y);
  3. void swap(int*x,int*y);
  4. int main(void){
  5. int x,y;
  6. scanf("%d",&x);
  7. scanf("%d",&y);
  8. sort(&x,&y);
  9. printf("x=%d,y=%d",x,y);
  10. }
  11. void sort(int*x,int*y){
  12. if(*x<*y){
  13. swap(&x,&y);
  14. }
  15. }
  16. void swap(int*x,int*y){
  17. int a;
  18. a=*x;
  19. *x=*y;
  20. *y=a;
  21. }
  22.  
Success #stdin #stdout 0s 5288KB
stdin
9 5
stdout
x=9,y=5