Cod sursa(job #640388)

Utilizator dia10Orgas Diana dia10 Data 25 noiembrie 2011 16:15:23
Problema Text Scor 10
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.34 kb
const semne=['.','!','?'];
var  s:string;
     f,g:text;
     i,c,n:integer;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
read(f,s);
for i:=1 to length(s) do
if (s[i]=' ') or (s[i] in semne) then
if (s[i-1]<>',') and (s[i-1]<>' ') and (s[i-1]<>'-') then c:=c+1;
write(g,(length(s))/c:4:2);
close(f);
close(g);
end.