Cod sursa(job #46359)

Utilizator raduzerRadu Zernoveanu raduzer Data 2 aprilie 2007 16:29:10
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.77 kb
var c,x:char;
    nr,m:longint;
begin
     assign(input,'text.in');
     reset(input);
     assign(output,'text.out');
     rewrite(output);
     read(c);
     x:=c;
     if (x>='a')and(x<='z')or(x>='A')and(x<='Z') then nr:=1;
     while not eof do
     begin
          read(c);
          if (c>='a')and(c<='z')or(c>='A')and(c<='Z') then nr:=nr+1;
          if ((x>='a')and(x<='z')or(x>='A')and(x<='Z'))
               and not ((c>='a')and(c<='z')or(c>='A')and(c<='Z')) then m:=m+1;
          x:=c;
     end;
     c:=' ';
     if (c>='a')and(c<='z')or(c>='A')and(c<='Z') then nr:=nr+1;
          if (x>='a')and(x<='z')or(x>='A')and(x<='Z')
               and not ((c>='a')and(c<='z')or(c>='A')and(c<='Z')) then m:=m+1;
     writeln(nr div m);
close(output);
end.