#include <stdio.h>
void scanfall(int *x,int *y,int *z);
void ascend(int *x,int *y,int *z);
void swap(int *x,int *y);
int main(void)
{
int a,b,c;
scanfall(&a,&b,&c);
ascend(&a,&b,&c);
printf("昇順: a=%d,b=%d,c=%d\n",a
,b
,c
); return 0;
}
void scanfall(int *x,int *y,int *z)
{
printf("入力: a=%d b=%d c=%d\n",*x
,*y
,*z
); }
void ascend(int *x,int *y,int *z)
{
if(*x>*y){
swap(x,y);
}
if(*x>*z){
swap(x,z);
}
if(*y>*z){
swap(y,z);
}
}
void swap(int *x,int *y)
{
int w;
w=*x;
*x=*y;
*y=w;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHNjYW5mYWxsKGludCAqeCxpbnQgKnksaW50ICp6KTsKdm9pZCBhc2NlbmQoaW50ICp4LGludCAqeSxpbnQgKnopOwp2b2lkIHN3YXAoaW50ICp4LGludCAqeSk7CgppbnQgbWFpbih2b2lkKQp7CglpbnQgYSxiLGM7CgkKCXNjYW5mYWxsKCZhLCZiLCZjKTsKCQoJYXNjZW5kKCZhLCZiLCZjKTsKCQoJcHJpbnRmKCLmmIfpoIY6IGE9JWQsYj0lZCxjPSVkXG4iLGEsYixjKTsKCXJldHVybiAwOwp9Cgp2b2lkIHNjYW5mYWxsKGludCAqeCxpbnQgKnksaW50ICp6KQp7CglzY2FuZigiJWQiLHgpOwoJc2NhbmYoIiVkIix5KTsKCXNjYW5mKCIlZCIseik7CglwcmludGYoIuWFpeWKmzogYT0lZCBiPSVkIGM9JWRcbiIsKngsKnksKnopOwp9Cgp2b2lkIGFzY2VuZChpbnQgKngsaW50ICp5LGludCAqeikKewoJaWYoKng+KnkpewoJCXN3YXAoeCx5KTsKCQl9CglpZigqeD4qeil7CgkJc3dhcCh4LHopOwoJfQoJaWYoKnk+KnopewoJCXN3YXAoeSx6KTsKCX0KfQoKdm9pZCBzd2FwKGludCAqeCxpbnQgKnkpCnsKCWludCB3OwoJdz0qeDsKCSp4PSp5OwoJKnk9dzsKfQ==