
Pegamand
4 год назад
Заполнить массив из 20 элементов случайными числами от -5 до 5. Вывести элементы с чётными числами
ОТВЕТЫ

Невена
Oct 24, 2020
Const
n = 20;
Var
A:array[1..n] of integer;
i:integer;
Begin
Randomize;
Write('Исходный массив: ');
For i:= 1 to N do
Begin
A[i]:=random(11)-5;
Write(' ',A[i])
End;
WriteLn;
Write('Чётные элементы:');
For i:= 1 to N do
if A[i] mod 2 = 0 then Write(' ',A[i]);
ReadLn
End.
n = 20;
Var
A:array[1..n] of integer;
i:integer;
Begin
Randomize;
Write('Исходный массив: ');
For i:= 1 to N do
Begin
A[i]:=random(11)-5;
Write(' ',A[i])
End;
WriteLn;
Write('Чётные элементы:');
For i:= 1 to N do
if A[i] mod 2 = 0 then Write(' ',A[i]);
ReadLn
End.
195
Смежные вопросы: