Cod sursa(job #34226)

Utilizator petrePajarcu Alexandru-Petrisor petre Data 20 martie 2007 13:49:11
Problema Text Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.42 kb
var f,g:text;
c,lit:char;
n,l:longint;
begin
assign(f,'text.in');
assign(g,'text.out');
reset(F);
rewrite(G);
n:=0;
l:=0;   lit:=' ';
while not eof(F) do
begin
while not eoln(F) do
begin
read(f,C);
if c in(['a'..'z']+['A'..'Z']) then inc(N)
else if lit in (['a'..'z']+['A'..'Z']) then inc(L);
lit:=c;
end;
if (c in(['a'..'z']+['A'..'Z'])) then l:=l+1;
end;
writeln(g,n div l);
close(F);
close(G);
end.