#include <stdio.h>
int main(void) {
void swap(int *x, int *y) {
int temp = *x;
*x = *y;
*y = temp;
}
int scanfall(int a, int b, int c) {
return (a > b || b > c);
}
void ascend(int *a, int *b, int *c) {
if (*a > *b) swap(a, b);
if (*b > *c) swap(b, c);
if (*a > *b) swap(a, b);
}
int main() {
int a, b, c;
if (scanfall(a, b, c)) {
ascend(&a, &b, &c);
}
printf("昇順:a=%d, b=%d, c=%d\n", a
, b
, c
);
return 0;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7Cgp2b2lkIHN3YXAoaW50ICp4LCBpbnQgKnkpIHsKICAgIGludCB0ZW1wID0gKng7CiAgICAqeCA9ICp5OwogICAgKnkgPSB0ZW1wOwp9CgppbnQgc2NhbmZhbGwoaW50IGEsIGludCBiLCBpbnQgYykgewogICAgcmV0dXJuIChhID4gYiB8fCBiID4gYyk7Cn0KCgp2b2lkIGFzY2VuZChpbnQgKmEsIGludCAqYiwgaW50ICpjKSB7CiAgICBpZiAoKmEgPiAqYikgc3dhcChhLCBiKTsKICAgIGlmICgqYiA+ICpjKSBzd2FwKGIsIGMpOwogICAgaWYgKCphID4gKmIpIHN3YXAoYSwgYik7Cn0KCmludCBtYWluKCkgewogICAgaW50IGEsIGIsIGM7CgogICAgCiAgICBzY2FuZigiJWQiLCAmYSk7CiAgICBzY2FuZigiJWQiLCAmYik7CiAgICBzY2FuZigiJWQiLCAmYyk7CgogICAgCiAgICBpZiAoc2NhbmZhbGwoYSwgYiwgYykpIHsKICAgICAgICBhc2NlbmQoJmEsICZiLCAmYyk7CiAgICB9CgogICAgCiAgICBwcmludGYoIuaYh+mghu+8mmE9JWQsIGI9JWQsIGM9JWRcbiIsIGEsIGIsIGMpOwoKICAgIHJldHVybiAwOwp9CgoJcmV0dXJuIDA7Cn0K