#include <stdio.h>
void swap(int *a, int *b) {
int num = *a;
*a = *b;
*b = num;
}
void sort(int *x, int *y) {
if (*x < *y) {
swap(x, y);
}
}
int main(void) {
int x = 5;
int y = 3;
printf("x = %d, y = %d\n", x
, y
); sort(&x, &y);
printf("x = %d, y = %d\n", x
, y
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHN3YXAoaW50ICphLCBpbnQgKmIpIHsKICAgIGludCBudW0gPSAqYTsKICAgICphID0gKmI7CiAgICAqYiA9IG51bTsKfQoKdm9pZCBzb3J0KGludCAqeCwgaW50ICp5KSB7CiAgICBpZiAoKnggPCAqeSkgewogICAgICAgIHN3YXAoeCwgeSk7CiAgICB9Cn0KCmludCBtYWluKHZvaWQpIHsKICAgIGludCB4ID0gNTsKICAgIGludCB5ID0gMzsKCiAgICBwcmludGYoInggPSAlZCwgeSA9ICVkXG4iLCB4LCB5KTsKICAgIHNvcnQoJngsICZ5KTsgCgogICAgcHJpbnRmKCJzb3J057WQ5p6cXG4iKTsKICAgIHByaW50ZigieCA9ICVkLCB5ID0gJWRcbiIsIHgsIHkpOwoKICAgIHJldHVybiAwOwp9