const n=5;
var
a:array [1..n] of integer;
sum,i,count:integer;
begin
sum:=0; count:=0;
for i:=1 to n do
readln(a[i]);
if (a[i] mod 2 = 1) and (a[i]>99) and (a[i]<1000) then
sum:=sum+ a[i];
inc(count);
end;
if count>0 then
writeln('Sr ar:', sum/count:4:2)
else writeln('Error');
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const n=5;
var
a:array [1..n] of integer;
sum,i,count:integer;
begin
sum:=0; count:=0;
for i:=1 to n do
begin
readln(a[i]);
if (a[i] mod 2 = 1) and (a[i]>99) and (a[i]<1000) then
begin
sum:=sum+ a[i];
inc(count);
end;
end;
if count>0 then
writeln('Sr ar:', sum/count:4:2)
else writeln('Error');
end.