Program Dasha Uses CRT Var size array of real summ count integer out r

 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
Program Dasha;
Uses
CRT;
Var
size: array[0..n] of real;
n, i, summ, count :integer;
out :real;
Begin
CLRSCR;
summ := 0;
count := 0;
Writeln('Количество учеников: ');
Readln(n);
For i:=1 to n do
Begin
Write('Ученик ', i, ' введите рост: ');
Read(size[i]);
if size[i] < 0 then
begin
summ := summ - size[i];
count := count + 1;
end;
End;
out := summ / count;
Writeln('Средний рост мальчиков: ', out);
End;