Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin
- var n := ReadLnInteger('Введите размер массива:');
- var arr := new integer[n];
- for var i := 0 to arr.Length - 1 do arr[i] := ReadLnInteger('Введите ' + Succ(i) + '-ый элемент массива:');
- WriteLn('Исходный массив:', newLine, arr);
- if arr.Where(x -> x < 0).Count <> 0 then
- begin
- var brr := new integer[arr.Where(x -> x < 0).Count];
- brr := arr.Where(x -> x < 0).ToArray;
- WriteLn('Сформированный массив:', newLine, brr);
- end
- else WriteLn('Отрицательных элементов нет :(');
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement