Cod sursa(job #49496)

Utilizator alex_mircescuAlex Mircescu alex_mircescu Data 5 aprilie 2007 20:15:09
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.69 kb
var u,cuv:longint;
    ch:char;
    wq:string;
    lit:set of char;
    cuvant:byte;

begin
assign(input,'text.in');
assign(output,'text.out');
reset(input);
rewrite(output);
lit:=['A'..'Z','a'..'z'];
cuv:=0;
u:=cuv;
cuvant:=0;
while not eof do
  begin
   while not eoln do
     begin
      read(ch);
      if ch in lit then
        begin
         cuvant:=1;
         inc(u);
        end;
      if (not (ch in lit)) and (cuvant=1) then
        begin
         cuvant:=0;
         inc(cuv);
        end;
     end;
   if cuvant=1 then
     begin
      cuvant:=0;
      inc(cuv);
     end;
   readln(wq);
  end;

write(u div cuv);
close(input);
close(output);
end.