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

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
新巴尔虎左旗| 拜城县| 甘德县| 洛宁县| 甘洛县| 长阳| 册亨县| 青铜峡市| 治县。| 柳州市| 凌云县| 韶关市| 龙里县| 当雄县| 阿拉尔市| 米林县| 班玛县| 上蔡县| 邹平县| 灵山县| 商河县| 兴和县| 图木舒克市| 兴义市| 望奎县| 临颍县| 武义县| 台前县| 大荔县| 水城县| 栖霞市| 正阳县| 陵川县| 鹤庆县| 绥阳县| 曲水县| 汝阳县| 油尖旺区| 封开县| 额尔古纳市| 昌乐县|