int main() {
int number;
// 提取各个位上的数字
int number_wan = number / 10000; // 提取万位
int number_qian = (number % 10000) / 1000; // 提取千位
int number_bai = (number % 10000 % 1000) / 100; // 提取百位
int number_shi = (number % 10000 % 1000 % 100) / 10; // 提取十位
int number_ge = number % 10000 % 1000 % 100 % 10; // 提取个位
// 根据不同的位数情况逆序输出
if (number_wan == 0) {
printf("%d %d %d %d %d\n", number_ge
, number_shi
, number_bai
, number_qian
, number_wan
); } else if (number_wan != 0 && number_qian == 0) {
printf("%d %d %d %d\n", number_ge
, number_shi
, number_bai
, number_wan
); } else if (number_wan != 0 && number_qian != 0 && number_bai == 0) {
printf("%d %d %d\n", number_ge
, number_shi
, number_wan
); } else if (number_wan != 0 && number_qian != 0 && number_bai != 0 && number_shi == 0) {
printf("%d %d\n", number_ge
, number_wan
); } else if (number_wan != 0 && number_qian != 0 && number_bai != 0 && number_shi != 0 && number_ge == 0) {
} else {
printf("%d %d %d %d %d\n", number_ge
, number_shi
, number_bai
, number_qian
, number_wan
); }
return 0;
}
CmludCBtYWluKCkgewogICAgaW50IG51bWJlcjsKICAgIHByaW50Zigi6K+36L6T5YWl5LiA5Liq5LiN5aSa5LqO5LqU5L2N5pWw55qE5pW05pWw77yaIik7CiAgICBzY2FuZigiJWQiLCAmbnVtYmVyKTsKCiAgICAvLyDmj5Dlj5blkITkuKrkvY3kuIrnmoTmlbDlrZcKICAgIGludCBudW1iZXJfd2FuID0gbnVtYmVyIC8gMTAwMDA7IC8vIOaPkOWPluS4h+S9jQogICAgaW50IG51bWJlcl9xaWFuID0gKG51bWJlciAlIDEwMDAwKSAvIDEwMDA7IC8vIOaPkOWPluWNg+S9jQogICAgaW50IG51bWJlcl9iYWkgPSAobnVtYmVyICUgMTAwMDAgJSAxMDAwKSAvIDEwMDsgLy8g5o+Q5Y+W55m+5L2NCiAgICBpbnQgbnVtYmVyX3NoaSA9IChudW1iZXIgJSAxMDAwMCAlIDEwMDAgJSAxMDApIC8gMTA7IC8vIOaPkOWPluWNgeS9jQogICAgaW50IG51bWJlcl9nZSA9IG51bWJlciAlIDEwMDAwICUgMTAwMCAlIDEwMCAlIDEwOyAvLyDmj5Dlj5bkuKrkvY0KCiAgICAvLyDmoLnmja7kuI3lkIznmoTkvY3mlbDmg4XlhrXpgIbluo/ovpPlh7oKICAgIGlmIChudW1iZXJfd2FuID09IDApIHsKICAgICAgICBwcmludGYoIiVkICVkICVkICVkICVkXG4iLCBudW1iZXJfZ2UsIG51bWJlcl9zaGksIG51bWJlcl9iYWksIG51bWJlcl9xaWFuLCBudW1iZXJfd2FuKTsKICAgIH0gZWxzZSBpZiAobnVtYmVyX3dhbiAhPSAwICYmIG51bWJlcl9xaWFuID09IDApIHsKICAgICAgICBwcmludGYoIiVkICVkICVkICVkXG4iLCBudW1iZXJfZ2UsIG51bWJlcl9zaGksIG51bWJlcl9iYWksIG51bWJlcl93YW4pOwogICAgfSBlbHNlIGlmIChudW1iZXJfd2FuICE9IDAgJiYgbnVtYmVyX3FpYW4gIT0gMCAmJiBudW1iZXJfYmFpID09IDApIHsKICAgICAgICBwcmludGYoIiVkICVkICVkXG4iLCBudW1iZXJfZ2UsIG51bWJlcl9zaGksIG51bWJlcl93YW4pOwogICAgfSBlbHNlIGlmIChudW1iZXJfd2FuICE9IDAgJiYgbnVtYmVyX3FpYW4gIT0gMCAmJiBudW1iZXJfYmFpICE9IDAgJiYgbnVtYmVyX3NoaSA9PSAwKSB7CiAgICAgICAgcHJpbnRmKCIlZCAlZFxuIiwgbnVtYmVyX2dlLCBudW1iZXJfd2FuKTsKICAgIH0gZWxzZSBpZiAobnVtYmVyX3dhbiAhPSAwICYmIG51bWJlcl9xaWFuICE9IDAgJiYgbnVtYmVyX2JhaSAhPSAwICYmIG51bWJlcl9zaGkgIT0gMCAmJiBudW1iZXJfZ2UgPT0gMCkgewogICAgICAgIHByaW50ZigiJWRcbiIsIG51bWJlcl93YW4pOwogICAgfSBlbHNlIHsKICAgICAgICBwcmludGYoIiVkICVkICVkICVkICVkXG4iLCBudW1iZXJfZ2UsIG51bWJlcl9zaGksIG51bWJlcl9iYWksIG51bWJlcl9xaWFuLCBudW1iZXJfd2FuKTsKICAgIH0KCiAgICByZXR1cm4gMDsKfQ==