fork download
  1. program project1;
  2.  
  3. var
  4. list: array [1..10] of integer;
  5. i, sum: integer;
  6.  
  7. begin
  8. randomize;
  9. sum := 1;
  10. for i:=1 to 10 do
  11. begin
  12. list[i] := random(5) - 2;
  13. write(list[i], ' ');
  14. end;
  15. writeln();
  16. for i:=1 to 10 do
  17. begin
  18. if list[i] <> 0 then
  19. sum := sum * list[i]
  20. end;
  21. writeln(sum);
  22.  
  23.  
  24. end.
Success #stdin #stdout 0s 4500KB
stdin
1 2 3 4 5 6 7 8 9 10
stdout
2 -1 2 0 2 -1 -2 0 1 -2 
32