Паскаль var m, k, i; integer; mas; array [1..10] of integer; begin mas[1]: =12; mas[2]: =-5; mas[3]=-14; mas [4]: =16; mas[5]: =-10; mas[6]: =-6; mas[7]: =8; mas[8]: =-10; mas[9]: =-15; mas[10]: =-8; m: =0; k: =0 for i: =1 to 10 do if (mas[i]< 0) and (i mod 2=0) then k: =k+1 else if mas[i]< 10 then m: =m+1 write(m+k) end.
1)
mas[1] = 12 | 12 < 0 - неверно & 12 < 10 - неверно
2)
mas[2] = -5 | -5 < 0 | i = 2 | 2 mod 2 = 0 - верно --> k=1
3)
mas[3] = -14 | -14 < 0 | i = 3 | 3 mod 2 = 0 - неверно & -14 < 10 - верно --> m=1
4)
mas[4] = 16 | 16 < 0 - неверно & 16 < 10 - неверно
5)
mas[5] = -10 | -10 < 0 | i = 5 | 5 mod 2 = 0 - неверно & -10 < 10 - верно --> m=2
6)
mas[6] = -6 | -6 < 0 | i = 6 | 6 mod 2 = 0 - верно --> k=2
7)
mas[7] = 8 | 8 < 0 - неверно & 8 < 10 - верно --> m=3
8)
mas[8] = -10 | -10 < 0 | i = 8 | 8 mod 2 = 0 - верно --> k=3
9)
mas[9] = -15 | -15 < 0 | i = 9 | 9 mod 2 = 0 - неверно & -15 < 10 - верно -->m=4
10)
mas[10] = -8 | -8 < 0 | i = 10 | 10 mod 2 = 0 - верно -->k=4
k+m = 4 + 4 = 8