### Uzdevums:

1p.
Vispirms masīva elementiem piešķir vērtības:
 $\begin{array}{l}\phantom{\rule{0.147em}{0ex}}\text{m}\left[-10\right]:=3;\phantom{\rule{0.147em}{0ex}}\\ \phantom{\rule{0.147em}{0ex}}\text{m}\left[-9\right]:=6;\\ \phantom{\rule{0.147em}{0ex}}\text{m}\left[-8\right]:=10;\\ \phantom{\rule{0.147em}{0ex}}\text{m}\left[-7\right]:=1;\\ \phantom{\rule{0.147em}{0ex}}\text{m}\left[-6\right]:=8;\end{array}$

 $\begin{array}{l}\phantom{\rule{0.147em}{0ex}}\mathrm{Rezultaats}:=0;\\ \phantom{\rule{0.147em}{0ex}}\mathbf{for}\phantom{\rule{0.147em}{0ex}}\text{i}:=-10\phantom{\rule{0.147em}{0ex}}\mathbf{to}\phantom{\rule{0.147em}{0ex}}-6\phantom{\rule{0.147em}{0ex}}\mathbf{do}\\ \phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\mathbf{if}\phantom{\rule{0.147em}{0ex}}\left(\text{i}\phantom{\rule{0.147em}{0ex}}\mathbf{mod}\phantom{\rule{0.147em}{0ex}}2=0\right)\\ \phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\mathrm{Rezultaats}:=\mathrm{Rezultaats}+\text{m}\left[\text{i}\right]\phantom{\rule{0.147em}{0ex}}\\ \phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\mathbf{else}\\ \phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\phantom{\rule{0.147em}{0ex}}\mathrm{Rezultaats}:=\mathrm{Rezultaats}-\text{m}\left[\text{i}\right];\phantom{\rule{0.147em}{0ex}}\end{array}$