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