Не могу понять корректность условия что именно надо сделать. Помогите перевести правильно. Код писать не прошу, сам сделаю, но не до конца понимаю задание.
File
in.properties
(pairskey=value
) contains some sequence of lines. Let the element with key indexi has the valuej
(i=1..n, j=1..m
– natural numbers without leading zeros). It determines the index of an element with name valueij (j = indexi
) you should work with.
- Print the sum of values of elements, having the key
valueij
(see examples below).- Print the number of index elements with “errors” (
i, j
– unnatural numbers; no correct value-element for sum).The example of the file
in.properties
:
index1 = 3
value11=qw
value12=4
value13 = 5.1
value14=2.7
index2=15
value21=
value22=
value23=
value24=k
value25=5
index3=1
value31= 3.14
value32=fgh
value33=5
index4=0
value41=
value42=e1
value43=2
value44=3
index5=b
value51=d
value52=e
Output:
sum = 8.24
error-lines = 3