Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin
- var arr := new real[61];
- arr[0] := -15.0;
- for var i := 1 to arr.length - 1 do arr[i] := arr[Pred(i)] + 0.5;
- WriteLn('Отрицательные элементы: ', newLine, arr.Where(x -> x < 0));
- WriteLn('Нулевые элементы: ', newLine, arr.Where(x -> x = 0));
- WriteLn('Положительные элементы: ', newLine, arr.Where(x -> x > 0));
- WriteLn('Всего элементов в последовательности - ', arr.Count, ', из них:');
- WriteLn('- кол-во отрицательных элементов: ', arr.Where(x -> x < 0).Count);
- WriteLn('- кол-во нулевых элементов: ', arr.Where(x -> x = 0).Count);
- WriteLn('- кол-во положительных элементов: ', arr.Where(x -> x > 0).Count);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement