.

- 7


( ) ?

( ) ?

s := 0 s = 0

do

famS, r, v read fam$, r, v

fam$= if fam$= then exit do

(fam$, v, r) ? fam$; v; r

s := s + v s = s + v

loop

vsum

= s vsum = s

( ec=,vsum) ? =; vsum

end

 

­ .

( )

( )

s: = 0 s0 = 0

fam$, r, v

fam$=

(fam$, v, r) <famk> <vk> <rk>

s:

= s + v sk = sk-1

+ vk

[k = (1...n)]

vsum

= s vsum = sn

( ec=,vsum) = <vsum>