最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊

【算法筆記】PAT A1002A+B for Polynomials

2021-12-30 22:18 作者:小幻不想碼代碼  | 我要投稿

https://pintia.cn/problem-sets/994805342720868352/problems/994805526272000000?

1002 A+B for Polynomials (25 分)

This time, you are supposed to find?A+B?where?A?and?B?are 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:

K?N1?aN1?N2?aN2?...?NK?aNK

where?K?is the number of nonzero terms in the polynomial,?Ni?and?aNi?(i=1,2,?,K) are the exponents and coefficients, respectively. It is given that?1≤K≤10,0≤NK<?<N2<N1≤1000.

Output Specification:

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.

Sample Input:

2 1 2.4 0 3.2

2 2 1.5 1 0.5結(jié)尾無空行

Sample Output:

3 2 1.5 1 2.9 0 3.2結(jié)尾無空行

題意:就是兩個(gè)多項(xiàng)式相加,每一行代表一個(gè)多項(xiàng)式,每一行第一個(gè)數(shù)代表非零系數(shù)的個(gè)數(shù),后面每兩個(gè)一組,分別代表次冪和系數(shù)。



【算法筆記】PAT A1002A+B for Polynomials的評論 (共 條)

分享到微博請遵守國家法律
江门市| 石城县| 孟津县| 灵璧县| 舞钢市| 遂平县| 沭阳县| 容城县| 许昌市| 温州市| 阿荣旗| 元阳县| 永年县| 东乡| 马鞍山市| 禹城市| 通江县| 平阳县| 偃师市| 嵩明县| 十堰市| 宁波市| 来安县| 卢龙县| 新建县| 普陀区| 黑水县| 雷山县| 西乌| 九江市| 军事| 西峡县| 嘉禾县| 舟曲县| 大洼县| 卢氏县| 勃利县| 宁国市| 都昌县| 阿鲁科尔沁旗| 三穗县|