#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) {
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;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBudW1iZXI7CiAgICBwcmludGYoIuivt+i+k+WFpeS4gOS4quS4jeWkmuS6juS6lOS9jeaVsOeahOaVtOaVsO+8miIpOwogICAgc2NhbmYoIiVkIiwgJm51bWJlcik7CgogICAgLy8g5o+Q5Y+W5ZCE5Liq5L2N5LiK55qE5pWw5a2XCiAgICBpbnQgbnVtYmVyX3dhbiA9IG51bWJlciAvIDEwMDAwOyAvLyDmj5Dlj5bkuIfkvY0KICAgIGludCBudW1iZXJfcWlhbiA9IChudW1iZXIgJSAxMDAwMCkgLyAxMDAwOyAvLyDmj5Dlj5bljYPkvY0KICAgIGludCBudW1iZXJfYmFpID0gKG51bWJlciAlIDEwMDAwICUgMTAwMCkgLyAxMDA7IC8vIOaPkOWPlueZvuS9jQogICAgaW50IG51bWJlcl9zaGkgPSAobnVtYmVyICUgMTAwMDAgJ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