#include <stdio.h>
void swap(int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
}
void sort(int *x, int *y) {
if (*x > *y) {
swap(x, y);
}
}
int main() {
int x=5, y=10;
sort(&x, &y);
printf("並べ替え後: x = %d, y = %d\n", x
, y
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHN3YXAoaW50ICphLCBpbnQgKmIpIHsKICAgIGludCB0ZW1wID0gKmE7CiAgICAqYSA9ICpiOwogICAgKmIgPSB0ZW1wOwp9CnZvaWQgc29ydChpbnQgKngsIGludCAqeSkgewogICAgaWYgKCp4ID4gKnkpIHsKICAgICAgICBzd2FwKHgsIHkpOwogICAgfQp9CgppbnQgbWFpbigpIHsKICAgIGludCB4PTUsIHk9MTA7CiAgIAogICAgc29ydCgmeCwgJnkpOwogICAgcHJpbnRmKCLkuKbjgbnmm7/jgYjlvow6IHggPSAlZCwgeSA9ICVkXG4iLCB4LCB5KTsKCiAgICByZXR1cm4gMDsKfQ==