This time, you are supposed to find A+B where A and B are two polynomials.
Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:
K N1 aN1 N2 aN2 ... NK aNK
where K is the number of nonzero terms in the polynomial, Ni and aNi (,) are the exponents and coefficients, respectively. It is given that 1,0.
For each test case you should output the sum of A and B in one line, with the same format as the input. Notice that there must be NO extra space at the end of each line. Please be accurate to 1 decimal place.
呜呜呜,说几个卡着的点
第一次错是因为系数是浮点型(嘤嘤嘤!数组也记得开浮点型嗷
第二个就是系数记得保留一位小数!!
上面是AC代码嘤嘤嘤溜了溜了
转载于:https://www.cnblogs.com/kazama/p/10877860.html
相关资源:JAVA上百实例源码以及开源项目