Cod sursa(job #524898)

Utilizator richforthegunioana ghita richforthegun Data 23 ianuarie 2011 15:53:15
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.47 kb
var s:string;
f,g:text;
c,j,i:longint;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
read(f,s);
j:=0; c:=0;
for i:=1 to ord(s[0]) do begin
                         if s[i] in ['a'..'z','A'..'Z'] then j:=j+1;
                         if (not(s[i] in ['a'..'z','A'..'Z'])) and (s[i-1] in ['a'..'z','A'..'Z']) then c:=c+1;
                         end;
    if s[i] in ['a'..'z','A'..'Z'] then c:=c+1;
j:=j div c;
write(g,j);
close(f);close(g);
end.