Program Dasha Uses CRT Var current summ count integer out real Begin t

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Program Dasha;
Uses
CRT;
Var
current, n, i, summ, count :integer;
out :real;
Begin
textbackground (CYAN);
textcolor(MAGENTA);
CLRSCR;
summ := 0;
count := 0;
Writeln('Количество учеников: ');
Read(n);
n := n + 1;
For i:=1 to n do
Begin
Write('Ученик ', i, ' введите рост: ');
Read(current);
if current < 0 then
begin
summ := summ - current;
count := count + 1;
end;
End;
out := summ / count;
Writeln('Средний рост мальчиков: ', out);
Readln;
End.