CiscoOA #8
Add Numbers
估计简单可在线判题
Two non-negative integers are represented as digit lists with the ones digit first; compute their sum and output it in the same reversed order. The input may contain high-order 0s; this site always removes extra high-order 0s from the result, and zero is output as a single 0.
输入格式
The input is the length n, n digits, the length m, and m digits, in that order. The original gave no numeric bounds; this site adds 1≤n,m≤100000, with each item in 0..9.
输出格式
Output the normalized reversed digits separated by spaces, without the length. Zero is output as a single 0.
样例 1
输入:
3
2 4 6
3
8 0 9
输出:
0 5 5 1
样例 2
输入:
1
9
1
1
输出:
0 1
样例 3
输入:
2
0 0
1
0
输出:
0
样例说明
The outputs of the three public examples are, in order: 0 5 5 1; 0 1; 0. Verified by independent enumeration or direct simulation.