Cod sursa(job #273445)

Utilizator andreirulzzzUPB-Hulea-Ionescu-Roman andreirulzzz Data 8 martie 2009 16:37:30
Problema Text Scor 60
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.69 kb
program texts;
var f:text;
    c:char;
    nrc,nrl,hold:longint;
    ok:boolean;
begin
nrl:=0; nrc:=0;
assign(f,'text.in');
reset(f);
while not eof(f) do begin
      read(f,c);ok:=false;
      case c of
           'a'..'z': begin
                     inc(nrl);
                     ok:=true;
                     end;
           'Z'..'Z': begin
                     inc(nrl);
                     ok:=true;
                     end;
           end;
      if not ok then inc(hold);
      if ok and (hold>0) then begin
         inc(nrc);
         hold:=0;
         end;
      end;
close(f);
inc(nrc);
assign(f,'text.out');
rewrite(f);
write(f,nrl div nrc);
close(f);
end.