PAT乙级 1049 数列的片段和 (20分) PAT甲级 1104 Sum of Number Segments (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个片段。给定正整数数列,求出全部片段包含的所有的数之和。如本例中