Advertisement
Alex_Fomin

Untitled

Dec 24th, 2015
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.80 KB | None | 0 0
  1. begin
  2.   var arr := new real[61];
  3.   arr[0] := -15.0;
  4.   for var i := 1 to arr.length - 1 do arr[i] := arr[Pred(i)] + 0.5;
  5.   WriteLn('Отрицательные элементы: ', newLine, arr.Where(x -> x < 0));
  6.   WriteLn('Нулевые элементы: ', newLine, arr.Where(x -> x = 0));
  7.   WriteLn('Положительные элементы: ', newLine, arr.Where(x -> x > 0));
  8.   WriteLn('Всего элементов в последовательности - ', arr.Count, ', из них:');
  9.   WriteLn('- кол-во отрицательных элементов: ', arr.Where(x -> x < 0).Count);
  10.   WriteLn('- кол-во нулевых элементов: ', arr.Where(x -> x = 0).Count);
  11.   WriteLn('- кол-во положительных элементов: ', arr.Where(x -> x > 0).Count);
  12. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement