#include <stdio.h>
// swap 関数:2つの値を入れ替える
void swap(int *a, int *b){
int temp=*a;
*a=*b;
*b=temp;
}
// sort 関数:x と y を降順に並べ替える(大きい方が x)
void sort(int *x, int *y){
if(*x<*y){
swap(x, y);
}
}
int main(void){
int x,y;
sort(&x, &y); // x と y のアドレスを渡す
printf("降順に並べ替えた結果: x = %d, y = %d\n", x
, y
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgovLyBzd2FwIOmWouaVsO+8mjLjgaTjga7lgKTjgpLlhaXjgozmm7/jgYjjgosKdm9pZCBzd2FwKGludCAqYSwgaW50ICpiKXsKICAgIGludCB0ZW1wPSphOwogICAgKmE9KmI7CiAgICAqYj10ZW1wOwp9CgovLyBzb3J0IOmWouaVsO+8mngg44GoIHkg44KS6ZmN6aCG44Gr5Lim44G55pu/44GI44KL77yI5aSn44GN44GE5pa544GMIHjvvIkKdm9pZCBzb3J0KGludCAqeCwgaW50ICp5KXsKICAgIGlmKCp4PCp5KXsKICAgICAgICBzd2FwKHgsIHkpOwogICAgfQp9CgppbnQgbWFpbih2b2lkKXsKICAgIGludCB4LHk7CiAgICAKICAgIHNjYW5mKCIlZCIsJngpOwoKICAgIHNjYW5mKCIlZCIsJnkpOwoKICAgIHNvcnQoJngsICZ5KTsgICAvLyB4IOOBqCB5IOOBruOCouODieODrOOCueOCkua4oeOBmQoKICAgIHByaW50Zigi6ZmN6aCG44Gr5Lim44G55pu/44GI44Gf57WQ5p6c77yaIHggPSAlZCwgeSA9ICVkXG4iLCB4LCB5KTsKCiAgICByZXR1cm4gMDsKfQoK