#include <stdio.h>
void sort(int *x, int *y);
void swap(int *a, int *b);
int main() {
int x, y;
sort(&x, &y);
printf("降順に並べ替えた x と y: 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+CnZvaWQgc29ydChpbnQgKngsIGludCAqeSk7CnZvaWQgc3dhcChpbnQgKmEsIGludCAqYik7CgppbnQgbWFpbigpIHsKICAgIGludCB4LCB5OwogICAgc2NhbmYoIiVkICVkIiwgJngsICZ5KTsKCiAgICBzb3J0KCZ4LCAmeSk7CiAgICBwcmludGYoIumZjemghuOBq+S4puOBueabv+OBiOOBnyB4IOOBqCB5OiB4ID0gJWQsIHkgPSAlZFxuIiwgeCwgeSk7CgogICAgcmV0dXJuIDA7Cn0Kdm9pZCBzb3J0KGludCAqeCwgaW50ICp5KSB7CiAgICBpZiAoKnggPCAqeSkgewogICAgICAgIHN3YXAoeCwgeSk7ICAKICAgIH0KfQp2b2lkIHN3YXAoaW50ICphLCBpbnQgKmIpIHsKICAgIGludCB0ZW1wID0gKmE7CiAgICAqYSA9ICpiOwogICAgKmIgPSB0ZW1wOwp9