天南之城的后花园

记录精彩的程序人生

文章

PAT 1009 多项式乘法

1009 Product of Polynomials This time, you are supposed to find A×B where A and B are two polynomials. 这次,你需要找到两个多项式 A 和 B 的乘积。 Input Specification: Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K\quad N_1\quad a_{N1}\quad N_2\quad a_{N2}\quad...\quad N_K\quad a_{NK} where K is the number of nonzero terms in the polynomial, N_i and a_{Ni} (i=1,2,⋯,K) are the exponents and coefficients, respectively. It is given that $....

PAT 1001 两数相加

1001 A+B Format Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). 计算a+b并以标准格式输出——也就是说,除非数字少于四位,否则数字必须用逗号分隔成三组。 Input Specification: Each input file contains one test case. Each case contains a pair of integers a and b where −106≤a,b≤106. The numbers are separated by a space. 每个输入文件包含一个测试用例。每个用例包含一对整数a和b,其中−106≤a,b≤106。数字由空格分隔。 Output Specification: For each test case, you should ou....

记录精彩的程序人生

© 2025 天南之城的后花园

Powered by Bolo
Theme bolo-sakura by Mashiro
浏览 50963 文章 43 评论 11
蜀ICP备2023008301号

主题 | Theme