Cod sursa(job #812876)
| Utilizator | Data | 14 noiembrie 2012 17:07:40 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.66 kb |
program tex;
var f,g:text;
s,cuv:string;
i,l,nr:longint;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
readln(f,s);
i:=1;nr:=0;l:=0;
while i<=length(s) do begin
while not (s[i] in ['a'..'z','A'..'Z']) and (i<=length(s)) do inc(i);
cuv:='';
while (s[i] in ['a'..'z','A'..'Z']) and (i<=length(s)) do begin
cuv:=cuv+s[i];
inc(i);
inc(l);
end;
if cuv<>'' then inc(nr);
end;
writeln(g,l div nr);
close(g);
end.
