#include<stdio.h>
int main()
{
int num = 0, t = 0, mask = 1,i=0;
int a[10];
scanf_s("%d", &num);
t = num;
while (t > 9) {
t /= 10;
mask *= 10;
}
while (mask > 0) {
a[i]=num / mask;
num %= mask;
mask /= 10;
i++;
}
printf("%d\n", i);
for (int j = 0; j < i; j++)
{
printf("%d ", a[j]);
}
printf("\n");
for (int j = i-1; j >=0; j--)
{
printf("%d", a[j]);
}
return 0;
}
取数借鉴了大佬的做法