Cod sursa(job #273442)

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