Cod sursa(job #130083)

Utilizator ioalexno1Alexandru Bunget ioalexno1 Data 31 ianuarie 2008 10:23:30
Problema Text Scor 90
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.41 kb
program alex;
var f:text;
    l,nr:longint;
    x,c:char;
begin
assign(f,'text.in');reset(f);
l:=0;
nr:=0;
c:=' ';
while not eof(f) do
      begin
      read(f,x);
      case x of
      'a'..'z','A'..'Z':l:=l+1
      else if((c>='a')and(c<='z'))or((c>='A')and(c<='Z')) then nr:=nr+1;
      end;
      c:=x;
      end;
close(f);
assign(f,'text.out');rewrite(f);
writeln(f,l div nr);
close(f);
end.