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