
СРОЧНО ПОЖАЛУЙСТА ,НУЖНО НАПИСАТЬ ПРОГРАММУ. 1.Дан массив чисел ,найти сумму элементов больше 10 и
меньше 20

Ответы на вопрос

var a:array[1..N] of integer;
s,K:integer;
begin
readln(K);
for i:=1 to N do readln(a[i]);
for i:=1 to N do
if (a[i] mod K=0) then s:=s+a[i];
write(s);
end.



Program to Find Sum of Elements Greater Than 10 and Less Than 20 in an Array
To solve this problem, you can use the following Python program:
```python # Given array of numbers arr = [5, 12, 8, 15, 18, 20, 10]
# Initialize sum total_sum = 0
# Iterate through the array for num in arr: if 10 < num < 20: total_sum += num
# Print the sum print("The sum of elements greater than 10 and less than 20 is:", total_sum) ```
This program initializes an array of numbers, iterates through the array, and adds the numbers that are greater than 10 and less than 20 to the total sum. Finally, it prints the total sum.
Note: This program assumes that the array of numbers is predefined. If you want to take input from the user, you can modify the program to include input statements for array elements.
I hope this helps! If you have any further questions or need additional assistance, feel free to ask.


Топ вопросов за вчера в категории Информатика
Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili