fork download
  1. program VLALR13;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6. SysUtils;
  7.  
  8. var
  9. vArr: array of Integer;
  10. i, sum, n: Integer;
  11. begin
  12. Randomize;
  13.  
  14. Write('Vvedite razmer massiva: ');
  15. ReadLn(n);
  16. SetLength(vArr, n);
  17.  
  18. sum := 0;
  19. Write('Massiv: ');
  20. for i := 0 to High(vArr) do
  21. begin
  22. vArr[i] := Random(100);
  23. Write(vArr[i], ' ');
  24. sum := sum + vArr[i];
  25. end;
  26.  
  27. WriteLn;
  28. WriteLn('Summa elementov massiva: ', sum);
  29. ReadLn;
  30. end.
  31.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Vvedite razmer massiva: Massiv: 
Summa elementov massiva: 0