Задача 6 Урок 15
Primary tabs
Пользователь вводит целые числа в цикле. Запишите в массив целых чисел (из 3 элементов) все нечетные отрицательные. Как только массив будет заполнен, завершите цикл ввода новых значений пользователем и распечатайте полученный массив
var
i,j:integer;
mas:array[1..3] of integer;
function Vvod():integer;
var b:integer;
begin
repeat
writeln('Vvedite celoe chislo');
readln(b);
until (b<0);
result:=b;
end;
begin
for i:=1 to 3 do
mas[i]:=Vvod();
for j:=1 to 3 do
write (mas[j],' ');
end.Консоль:
Vvedite celoe chislo -4 Vvedite celoe chislo 5 Vvedite celoe chislo -3 Vvedite celoe chislo -9 -4 -3 -9
- Log in to post comments
- 743 reads