Advertisement
destr0y

Lab5_1

Mar 21st, 2020
3,417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var a := new Stack<integer>;
  2. s: integer;
  3. begin
  4.   for var i := 1 to 10 do
  5.     a.Push(random(-10,20));
  6.  
  7.   writeln(a);
  8.  
  9.   s := a.Where(x -> x > 0).Sum();
  10.   writeln(s);
  11.  
  12. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement