program vek; uses crt; var a,b,c,d,e,f,y,q,x,m:integer; p:real; begin writeln ('Zadej pocet lidi?: '); readln (q); y:=0; a:=0; b:=0; c:=0; d:=0; e:=0; f:=0; for x:= 1 to q do begin write ('Vek ',x,'. osoby: '); read (m); if (m<7) then a:=a+1; if (m>6) and (m<15) then b:=b+1; if (m>14) and (m<19) then c:=c+1; if (m>18) and (m<41) then d:=d+1; if (m>40) and (m<64) then e:=e+1; if (m>63) then f:=f+1; y:=y+m; end; Writeln ('Prehled pohle veku: '); writeln ('predskolaku: ',a); writeln ('skolaku: ',b); writeln ('strdoskolaku: ',c); writeln ('stredni vek: ',d); writeln ('vyssi vek: ',e); writeln ('duchodce: ',f); p:=y/q; writeln ('Vekovy prumer je: ',p:2:2); readln; readln; clrscr; end.