#170. 列表数字过滤:移除末位为9
列表数字过滤:移除末位为9
Filter Numbers Not Ending with 9
Background
Dawei is organizing a list of numbers. He dislikes numbers ending with and wants your help to remove them from the list.
Problem Description
Given a list of non-negative integers, return a new list containing all numbers from the original list that do not end with . A number ends with if its remainder when divided by is .
Input Format
Input is given from standard input in the following format.
The input consists of a single line containing several non-negative integers, separated by spaces.
Output Format
Output is printed to standard output in the following format.
The output should be a single line representing the filtered list of numbers. Numbers in the list should be separated by commas and spaces, enclosed in square brackets
[]. If the list is empty, output[].
Sample
1 2 19
[1, 2]
9 19 29 3
[3]
1 2 3
[1, 2, 3]
Sample Explanation
For Sample 1, the input list is [1, 2, 19]. The number ends with , so it is removed. The final list is [1, 2].
For Sample 2, the input list is [9, 19, 29, 3]. The numbers all end with , so they are removed. The final list is [3].
For Sample 3, the input list is [1, 2, 3]. None of the numbers end with , so all are kept. The final list is [1, 2, 3].
Constraints
The time limit for each test case is second, and the memory limit is KiB.