Ответ:
Объяснение:
program Randomizer;
const
RndLimit = 10000;
var
x, SumX : integer;
begin
SumX := 0;
Repeat x := Random(RndLimit) until x > 999;
writeln ('Random X= ', x);
SumX := SumX + (x div 1000) + (x mod 1000 div 100) + (x mod 1000 mod 100 div 10) + (x mod 1000 mod 100 mod 10);
writeln ('Sum = ', SumX);
end.
============== запускаем===================
Free Pascal Compiler version 2.6.2-8 [2014/01/22] for x86_64
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling main.pas
Linking a.out
21 lines compiled, 0.1 sec
Random X= 5488
Sum = 25