资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

菜鸟记录PAT甲级1002--Polynomials

  开始前有必要说一下,这才第二题就碰到了烂尾题,以自己开始的思路交了n次,错了n词,最后才19分,后来看了一下大佬的c++代码(尽然没有c的代码),还好c和c++的差别不是特别大,仔细琢磨一遍后突然发现很多地方可以改进,整理思路在此尝试终于AC,这才第二题啊。。。。

成都创新互联公司主营东胜网站建设的网络公司,主营网站建设方案,成都App制作,东胜h5小程序设计搭建,东胜网站营销推广欢迎东胜等地区企业咨询

This time, you are supposed to findA+BwhereAandBare two polynomials.

Input Specification:

Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:

KN1aN1N2aN2...NKaNK

whereKis the number of nonzero terms in the polynomial,NiandaNi(i=1,2,,K) are the exponents and coefficients, respectively. It is given that1K10,0NK<<N2<N11000.

Output Specification:

For each test case you should output the sum ofAandBin 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.

Sample Input:

2 1 2.4 0 3.2
2 2 1.5 1 0.5

当前题目:菜鸟记录PAT甲级1002--Polynomials
网站URL:http://cdkjz.cn/article/dsoieei.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220