Объяснение:
var
a: array [1..10] of integer;
i, sum: integer;
begin
randomize;
sum := 0;
for i := 1 to 10 do
a[i] := Random(10) + 1;
write(a[i]:5);
if odd(a[i]) then
sum := sum + a[i];
end;
writeln;
Writeln('Sum: ', sum);
end.
Объяснение:
var
a: array [1..10] of integer;
i, sum: integer;
begin
randomize;
sum := 0;
for i := 1 to 10 do
begin
a[i] := Random(10) + 1;
write(a[i]:5);
if odd(a[i]) then
sum := sum + a[i];
end;
writeln;
Writeln('Sum: ', sum);
end.