Код
Program laba1;
uses crt;
type name=(V, G, Ge, K, M, N, S, T, F, Sh); {Валя, Гена, Женя, Коля, Маша, Нина, Саша, Таня, Федя, Шура}
var Pol: array [name] of (Man,Woman); {мужской, женский}
Rost: array [name] of 140..200;
o,i,j:integer;
z,r:real;
c:name;
begin
clrscr;
r:=0;
o:=0;
z:=0;
Writeln ('Введите пол (1:Man, 2:Woman): ');
for c:=V to Sh do
begin
Case C of
V:write ('Валя: ');
G:write ('Гена: ');
Ge:write ('Женя: ');
K:write ('Коля: ');
M:write ('Маша: ');
N:write ('Нина: ');
S:write ('Саша: ');
T:write ('Таня: ');
F:write ('Федор: ');
Sh:write ('Шура: ')
end;
readln (i);
end;
Case i of
1:pol[c]:=Man;
2:pol[c]:=Woman;
end;
Writeln ('Введите рост (от 140 до 200): ');
For c:=V to Sh do
begin
case c of
V:write ('Валя: ');
G:write ('Гена: ');
Ge:write ('Женя: ');
K:write ('Коля: ');
M:write ('Маша: ');
N:write ('Нина: ');
S:write ('Саша: ');
T:write ('Таня: ');
F:write ('Федор: ');
Sh:write ('Шура: ')
end;
readln (j);
If pol[c]=Woman then
begin
r:=r+j;
o:=o+1;
end;
end;
If o=0 then writeln ('Невозможно вычислить средний рост женщин!') else
begin
z:=r/o;
Writeln;
Writeln ('Средний рост женщин: ',z:8:3);
end
end.