fork download
  1. #include <stdio.h>
  2.  
  3. void sort(int *x,int *y);
  4. void swap(int *x,int *y);
  5.  
  6. int main(void) {
  7. int a=6;
  8. int b=7;
  9. sort(&a,&b);
  10. printf("%d %d\n",a,b);
  11. return 0;
  12. }
  13. void sort(int *x,int *y){
  14. if(*x<*y){
  15. swap(x,y);
  16. }
  17. }
  18. void swap(int *x,int *y){
  19. int temp;
  20. temp=*x;
  21. *x=*y;
  22. *y=temp;
  23. }
  24.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
7  6