Cod sursa(job #642606)

Utilizator andrei_toaderToader Andrei Sorin andrei_toader Data 1 decembrie 2011 19:55:03
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.52 kb
program tea;
var f,g:text;
    s:ansistring;
    i:longint;
    lit,cuv:longint;

begin
 assign (f,'text.in'); reset (f);
 assign (g,'text.out'); rewrite (g);
 read (f,s);
 lit:=0; cuv:=0;
 for i:=1 to length (S) do
 begin
  if (s[i]>='A') and (s[i]<='z') then
   lit:=lit+1
  else
  if ((s[i]<'A') or (s[i]>'z'))  and (s[i-1]>='A') and (s[i-1]<='z') and (i>1) then
   cuv:=cuv+1;
 end;
 if (s[length (s)]>='A') and (s[length (S)]<='z') then
  cuv:=cuv+1;
 write (g,trunc(lit/cuv));
 close (f);
 close (g);
end.