#include <stdio.h>
void swap(int *a,int *b){
int c=*a;
*a=*b;
*b=c;
}
void sort(int *x,int *y){
if(*x<*y){
swap(x,y);
}
}
int main(void) {
int x=1;
int y=4;
printf("sort前: x=%d y=%d\n",x
,y
); sort(&x,&y);
printf("sort後: x=%d y=%d\n",x
,y
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHN3YXAoaW50ICphLGludCAqYil7CglpbnQgYz0qYTsKICAgICAqYT0qYjsKCSAqYj1jOwp9CgoKdm9pZCBzb3J0KGludCAqeCxpbnQgKnkpewoJaWYoKng8KnkpewoJCXN3YXAoeCx5KTsKCX0KfQoKaW50IG1haW4odm9pZCkgewoJaW50IHg9MTsKCWludCB5PTQ7CgkKCXByaW50Zigic29ydOWJjTogeD0lZCB5PSVkXG4iLHgseSk7Cglzb3J0KCZ4LCZ5KTsKCQoJcHJpbnRmKCJzb3J05b6MOiB4PSVkIHk9JWRcbiIseCx5KTsKCQoJCgkKCXJldHVybiAwOwp9Cg==