-->
当前位置:首页 > 题库

PROGRAMMING:Addition of polynomials of one variable

Luz5年前 (2021-05-10)题库381
Design program to find the sum of two polynomials of one variable.
###Input format:
The input is divided into two lines. In each line, the number of non-zero terms of polynomial is given, and then a coefficient and exponent of non-zero terms of polynomial are input exponentially. Numbers are separated by spaces.
###Output format:
Output 1 line, output the coefficients and exponents of non-zero terms of polynomial in exponential descending mode (ensure that they do not exceed the range of integer representation). The numbers are separated by spaces, but there should be no extra spaces at the end. The zero polynomial should output 0.
###Input example:
```in
4 3 4 -5 2 6 1 -2 0
3 5 20 -7 4 3 1
```
###Output example:
```out
5 20 -4 4 -5 2 9 1 -2 0
```







answer:If there is no answer, please comment