Задание № 1. Ответ: см. картинку
Задание № 2. Ответ: 7
1.
K := 1 S := 1 N := 3
K > N (1 > 3 нет)
S := S + K = 1 + 1 = 2
K := K + 1 = 1 + 1 = 2
2.
K := 2 S := 2 N := 3
K > N (2 > 3 нет)
S := S + K = 2 + 2 = 4
K := K + 1 = 2 + 1 = 3
3.
K := 3 S := 4 N := 3
K > N (3 > 3 нет)
S := S + K = 4 + 3 = 7
K := K + 1 = 3 + 1 = 4
4.
K := 4 S := 7 N := 3
K > N (4 > 3 да)
S := 7
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Задание № 1. Ответ: см. картинку
Задание № 2. Ответ: 7
1.
K := 1 S := 1 N := 3
K > N (1 > 3 нет)
S := S + K = 1 + 1 = 2
K := K + 1 = 1 + 1 = 2
2.
K := 2 S := 2 N := 3
K > N (2 > 3 нет)
S := S + K = 2 + 2 = 4
K := K + 1 = 2 + 1 = 3
3.
K := 3 S := 4 N := 3
K > N (3 > 3 нет)
S := S + K = 4 + 3 = 7
K := K + 1 = 3 + 1 = 4
4.
K := 4 S := 7 N := 3
K > N (4 > 3 да)
S := 7