#include <stdio.h>
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) {
if (number_qian == 0) {
if (number_bai == 0) {
if (number_shi == 0) {
printf("%d\n", number_ge
); // 只有个位 } else {
printf("%d %d\n", number_shi
, number_ge
); // 只有十位和个位 }
} else {
printf("%d %d %d\n", number_bai
, number_shi
, number_ge
); // 只有百位、十位和个位 }
} else {
printf("%d %d %d %d\n", number_qian
, number_bai
, number_shi
, number_ge
); // 只有千位、百位、十位和个位 }
} else {
printf("%d %d %d %d %d\n", number_wan
, number_qian
, number_bai
, number_shi
, number_ge
); // 万位、千位、百位、十位和个位 }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBudW1iZXI7CiAgICBwcmludGYoIuivt+i+k+WFpeS4gOS4quS4jeWkmuS6juS6lOS9jeaVsOeahOaVtOaVsO+8miIpOwogICAgc2NhbmYoIiVkIiwgJm51bWJlcik7CgogICAgLy8g5o+Q5Y+W5ZCE5Liq5L2N5LiK55qE5pWw5a2XCiAgICBpbnQgbnVtYmVyX3dhbiA9IG51bWJlciAvIDEwMDAwOyAvLyDmj5Dlj5bkuIfkvY0KICAgIGludCBudW1iZXJfcWlhbiA9IChudW1iZXIgJSAxMDAwMCkgLyAxMDAwOyAvLyDmj5Dlj5bljYPkvY0KICAgIGludCBudW1iZXJfYmFpID0gKG51bWJlciAlIDEwMDAwICUgMTAwMCkgLyAxMDA7IC8vIOaPkOWPlueZvuS9jQogICAgaW50IG51bWJlcl9zaGkgPSAobnVtYmVyICUgMTAwMDAgJSAxMDAwICUgMTAwKSAvIDEwOyAvLyDmj5Dlj5bljYHkvY0KICAgIGludCBudW1iZXJfZ2UgPSBudW1iZXIgJSAxMDAwMCAlIDEwMDAgJSAxMDAgJSAxMDsgLy8g5o+Q5Y+W5Liq5L2NCgogICAgLy8g5qC55o2u5LiN5ZCM55qE5L2N5pWw5oOF5Ya16YCG5bqP6L6T5Ye6CiAgICBpZiAobnVtYmVyX3dhbiA9PSAwKSB7CiAgICAgICAgaWYgKG51bWJlcl9xaWFuID09IDApIHsKICAgICAgICAgICAgaWYgKG51bWJlcl9iYWkgPT0gMCkgewogICAgICAgICAgICAgICAgaWYgKG51bWJlcl9zaGkgPT0gMCkgewogICAgICAgICAgICAgICAgICAgIHByaW50ZigiJWRcbiIsIG51bWJlcl9nZSk7IC8vIOWPquacieS4quS9jQogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBwcmludGYoIiVkICVkXG4iLCBudW1iZXJfc2hpLCBudW1iZXJfZ2UpOyAvLyDlj6rmnInljYHkvY3lkozkuKrkvY0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHByaW50ZigiJWQgJWQgJWRcbiIsIG51bWJlcl9iYWksIG51bWJlcl9zaGksIG51bWJlcl9nZSk7IC8vIOWPquacieeZvuS9jeOAgeWNgeS9jeWSjOS4quS9jQogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgcHJpbnRmKCIlZCAlZCAlZCAlZFxuIiwgbnVtYmVyX3FpYW4sIG51bWJlcl9iYWksIG51bWJlcl9zaGksIG51bWJlcl9nZSk7IC8vIOWPquacieWNg+S9jeOAgeeZvuS9jeOAgeWNgeS9jeWSjOS4quS9jQogICAgICAgIH0KICAgIH0gZWxzZSB7CiAgICAgICAgcHJpbnRmKCIlZCAlZCAlZCAlZCAlZFxuIiwgbnVtYmVyX3dhbiwgbnVtYmVyX3FpYW4sIG51bWJlcl9iYWksIG51bWJlcl9zaGksIG51bWJlcl9nZSk7IC8vIOS4h+S9jeOAgeWNg+S9jeOAgeeZvuS9jeOAgeWNgeS9jeWSjOS4quS9jQogICAgfQoKICAgIHJldHVybiAwOwp9