program HelloWorld;
const N = 10;
var m:array [1..N] of real;
var i: integer;
var j: integer;
var summ: real;
begin
summ:=0;
for i := 1 to N do
j:= 5 + random(10);
m[i]:=j;
if j mod 2 = 0 then m[i]:=m[i]/2;
summ:=summ+m[i];
end;
write(summ:10:0);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
program HelloWorld;
const N = 10;
var m:array [1..N] of real;
var i: integer;
var j: integer;
var summ: real;
begin
summ:=0;
for i := 1 to N do
begin
j:= 5 + random(10);
m[i]:=j;
if j mod 2 = 0 then m[i]:=m[i]/2;
summ:=summ+m[i];
end;
write(summ:10:0);
end.