Cod sursa(job #342304)

Utilizator andrey932Andrei andrey932 Data 21 august 2009 12:04:08
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.48 kb
var t:text;
    i,s,nrl,nrc,l:longint;
    c:char;

begin
nrc:=0;
nrl:=0;
assign(t,'text.in'); reset(t);
while not(eof(t)) do
  begin
    l:=0;
    read(t,c);
    while ( ((65<=ord(c)) and (ord(c)<=90)) or ((97<=ord(c)) and (ord(c)<=122))) do
      begin
        l:=l+1;
        read(t,c);
      end;
    if l<>0 then
      begin
        nrc:=nrc+1;
        nrl:=nrl+l;
      end;
  end;
assign(t,'text.out'); rewrite(t);
writeln(t,trunc(nrl/nrc));
close(t);
end.