← 返回 cisco 的题目列表Add Two Reversed Digit Lists
类型:qbank
Two lists store non-negative integers in reverse digit order. Add the numbers and print the result as reverse-order digits.
Requirements
Input line 1 is list1_size, the size of the first list.
Input line 2 contains the digits of the first list.
Input line 3 is list2_size, the size of the second list.
Input line 4 contains the digits of the second list.
The digits are stored in reverse order.
Print K space-separated integers representing the digits of the sum, also in reverse order.
Examples
Input:
3
2 4 6
3
8 0 9
Output is the reverse-order digit list for adding the two represented numbers.
Notes
The visible statement gives the full input/output shape, but the screenshot cuts off part of the example explanation. Treat carry handling and unequal list lengths as required hidden cases.