题目描述
Give an integer of no more than 5 digits.
Requires:
- Find out how many digits it is.
- Output each digit separately.
- Output each digit in reverse order.
For example, the original number is 321 and should output 123.
输入
a number no larger than 5 digits.
输出
Three lines:
First line, number of digits
Second line, each number separated by a space, note that there is no space after the last number.
Third line, output this number in reverse order
样例输入 Copy
12345
样例输出 Copy
5
1 2 3 4 5
54321
提示
number to string
n=input()
print(len(str(n)))
for i in n:
print(i,end=' ')
print()
print(n[::-1])