#165. 提取数字个位
提取数字个位
Extract Rightmost Digits
Background
Congcong is learning about number manipulation and has encountered an interesting task: extracting the rightmost digit from a series of numbers.
Problem Description
Given a list of non-negative integers, return an integer list of their rightmost digits. (Hint: use the modulo operator %)
Input Format
Input is given from standard input in the following format.
A single line containing a string representing a list of non-negative integers. The list is enclosed in square brackets
[and], and integers are separated by spaces. For example:[1 22 93].
Output Format
Output is printed to standard output in the following format.
A single line containing a string representing the list of extracted rightmost digits. The list is enclosed in square brackets
[and], and digits are separated by commas and spaces,. For example:[1, 2, 3].
Sample
[1 22 93]
[1, 2, 3]
[16 8 886 8 1]
[6, 8, 6, 8, 1]
[10 0]
[0, 0]
Sample Explanation
Sample 1: The rightmost digit of 1 is 1, of 22 is 2, and of 93 is 3.
Sample 2: The rightmost digit of 16 is 6, of 8 is 8, of 886 is 6, of 8 is 8, and of 1 is 1.
Sample 3: The rightmost digit of 10 is 0, and of 0 is 0.
Constraints
Time limit: 1 second, Memory limit: 1024 KiB for each test case.