#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(void)
{
int x, y;
sort(&x, &y);
printf("並び替え後: x = %d, y = %d\n", x
, y
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHN3YXAoaW50ICphLCBpbnQgKmIpCnsKICAgIGludCB0ZW1wID0gKmE7CiAgICAqYSA9ICpiOwogICAgKmIgPSB0ZW1wOwp9CnZvaWQgc29ydChpbnQgKngsIGludCAqeSkKewogICAgaWYgKCp4IDwgKnkpIHsKICAgICAgICBzd2FwKHgsIHkpOyAKICAgIH0KfQoKaW50IG1haW4odm9pZCkKewogICAgaW50IHgsIHk7CgogICAgcHJpbnRmKCJ4IOOCkuWFpeWKm+OBl+OBpuOBj+OBoOOBleOBhDogIik7CiAgICBzY2FuZigiJWQiLCAmeCk7CgogICAgcHJpbnRmKCJ5IOOCkuWFpeWKm+OBl+OBpuOBj+OBoOOBleOBhDogIik7CiAgICBzY2FuZigiJWQiLCAmeSk7CgogICAgc29ydCgmeCwgJnkpOwoKICAgIHByaW50Zigi5Lim44Gz5pu/44GI5b6MOiB4ID0gJWQsIHkgPSAlZFxuIiwgeCwgeSk7CgpyZXR1cm4gMDsKfQ==