PTA
文章平均质量分 53
KrisFeng00
这个作者很懒,什么都没留下…
展开
-
1049 数列的片段和 (20 分)
1049 数列的片段和 (20 分) 给定一个正数数列,我们可以从中截取任意的连续的几个数,称为片段。例如,给定数列 { 0.1, 0.2, 0.3, 0.4 },我们有 (0.1) (0.1, 0.2) (0.1, 0.2, 0.3) (0.1, 0.2, 0.3, 0.4) (0.2) (0.2, 0.3) (0.2, 0.3, 0.4) (0.3) (0.3, 0.4) (0.4) 这 10 个片段。 给定正整数数列,求出全部片段包含的所有的数之和。如本例中 10 个片段总和是 0.1 + 0.3 +原创 2021-09-09 16:22:51 · 82 阅读 · 0 评论 -
1024 科学计数法 (20 分)
1024 科学计数法 (20 分) 科学计数法是科学家用来表示很大或很小的数字的一种方便的方法,其满足正则表达式 [±][1-9].[0-9]+E[±][0-9]+,即数字的整数部分只有 1 位,小数部分至少有 1 位,该数字及其指数部分的正负号即使对正数也必定明确给出。 现以科学计数法的格式给出实数 A,请编写程序按普通数字表示法输出 A,并保证所有有效位都被保留。 输入格式: 每个输入包含 1 个测试用例,即一个以科学计数法表示的实数 A。该数字的存储长度不超过 9999 字节,且其指数的绝对值不超过原创 2021-09-06 17:11:46 · 71 阅读 · 0 评论 -
1093 字符串A+B (20 分)
1093 字符串A+B (20 分) 给定两个字符串 A 和 B,本题要求你输出 A+B,即两个字符串的并集。要求先输出 A,再输出 B,但重复的字符必须被剔除。 输入格式: 输入在两行中分别给出 A 和 B,均为长度不超过 10 6 的、由可见 ASCII 字符 (即码值为32~126)和空格组成的、由回车标识结束的非空字符串。 输出格式: 在一行中输出题面要求的 A 和 B 的和。 输入样例: This is a sample test to show you_How it works 输出样例 Th原创 2021-08-19 11:09:41 · 55 阅读 · 0 评论 -
1009 Product of Polynomials (25 分)
1009 Product of 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原创 2021-04-07 13:20:39 · 60 阅读 · 0 评论 -
1008 Elevator (20 分)
1008 Elevator (20 分) The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one fl原创 2021-04-07 09:10:47 · 52 阅读 · 0 评论 -
1007 Maximum Subsequence Sum (25 分)
1007 Maximum Subsequence Sum (25 分)原创 2021-04-06 20:25:41 · 63 阅读 · 0 评论 -
1005 Spell It Right (20 分)
1005 Spell It Right (20)(20 分) Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains one test case. Each case occupies one line wh原创 2021-04-06 13:53:51 · 66 阅读 · 0 评论 -
PTA1002A+B for Polynomials
PTA 1002A+B for Polynomials1002 A+B for Polynomials (25分) 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原创 2021-03-29 10:08:21 · 86 阅读 · 0 评论