#include <stdio.h>
// swap関数の定義
void swap(int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
}
// sort関数の定義
void sort(int *x, int *y) {
if (*x < *y) {
swap(x, y);
}
}
int main(void) {
int x = 3, y = 2;
sort(&x, &y);
printf("sort結果: x = %d, y = %d\n", x
, y
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgovLyBzd2Fw6Zai5pWw44Gu5a6a576pCnZvaWQgc3dhcChpbnQgKmEsIGludCAqYikgewogICAgaW50IHRlbXAgPSAqYTsKICAgICphID0gKmI7CiAgICAqYiA9IHRlbXA7Cn0KCi8vIHNvcnTplqLmlbDjga7lrprnvqkKdm9pZCBzb3J0KGludCAqeCwgaW50ICp5KSB7CiAgICBpZiAoKnggPCAqeSkgewogICAgICAgIHN3YXAoeCwgeSk7CiAgICB9Cn0KCmludCBtYWluKHZvaWQpIHsKICAgIGludCB4ID0gMywgeSA9IDI7CgogICAgc29ydCgmeCwgJnkpOwogICAgcHJpbnRmKCJzb3J057WQ5p6cOiB4ID0gJWQsIHkgPSAlZFxuIiwgeCwgeSk7CgogICAgcmV0dXJuIDA7Cn0K