#include <stdio.h>
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;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHN3YXAoaW50ICp4LCBpbnQgKnkpIHsKICAgIGludCB0ZW1wID0gKng7CiAgICAqeCA9ICp5OwogICAgKnkgPSB0ZW1wOwp9CgppbnQgc2NhbmZhbGwoaW50ICphLCBpbnQgKmIsIGludCAqYykgewogICAgc2NhbmYoIiVkIiwgYSk7CiAgICBzY2FuZigiJWQiLCBiKTsKICAgIHNjYW5mKCIlZCIsIGMpOwoKICAgIHJldHVybiAoKmEgPiAqYiB8fCAqYiA+ICpjKTsKfQoKdm9pZCBhc2NlbmQoaW50ICphLCBpbnQgKmIsIGludCAqYykgewogICAgaWYgKCphID4gKmIpIHN3YXAoYSwgYik7CiAgICBpZiAoKmIgPiAqYykgc3dhcChiLCBjKTsKICAgIGlmICgqYSA+ICpiKSBzd2FwKGEsIGIpOwp9CgppbnQgbWFpbigpIHsKICAgIGludCBhLCBiLCBjOwoKICAgIGlmIChzY2FuZmFsbCgmYSwgJmIsICZjKSkgewogICAgICAgIGFzY2VuZCgmYSwgJmIsICZjKTsKfQogICAKICAgIHByaW50Zigi5piH6aCG77yaYT0lZCwgYj0lZCwgYz0lZFxuIiwgYSwgYiwgYyk7CgogICAgcmV0dXJuIDA7Cn0KCiAgICA=