СРОЧНО!!! ДАЮ 50 БАЛЛОВ
Определи, что будет выведено в результате работы программы:
program prog;
var i, s: integer;
arr: array [1..10] of integer;
begin
for i := 1 to 10 do arr[i] := i * 7 + 3;
s := 0;
for i := 1 to 10 do
begin
if arr[i] mod 4 = 0 then s := s + arr[i];
end;
write(s)
end.
Запиши ответ числом.
Answers & Comments
Ответ:
76
Объяснение:
i = 1, arr[1] = 1 * 7 + 3 = 7 + 3 = 10
i = 2, arr[2] = 2 * 7 + 3 = 14 + 3 = 17
i = 3, arr[3] = 3 * 7 + 3 = 21 + 3 = 24
i = 4, arr[4] = 4 * 7 + 3 = 28 + 3 = 31
i = 5, arr[5] = 5 * 7 + 3 = 35 + 3 = 38
i = 6, arr[6] = 6 * 7 + 3 = 42 + 3 = 45
i = 7, arr[7] = 7 * 7 + 3 = 49 + 3 = 52
i = 8, arr[8] = 8 * 7 + 3 = 56 + 3 = 59
i = 9, arr[9] = 9 * 7 + 3 = 63 + 3 = 66
i = 10, arr[10] = 10 * 7 + 3 = 70 + 3 = 73
10 / 4 = 2,5
17 / 4 = 4,25
24 / 4 = 6
31 / 4= 7,75
38 / 4 = 9,5
45 / 4 = 11,25
52 / 4 = 13
59 / 4 = 14,75
66 / 4 = 16,5
73 / 4 = 18,25
s = 0 + 24 + 52 = 76