Cod sursa(job #835776)

Utilizator IronKingqwerty xxx IronKing Data 16 decembrie 2012 11:02:24
Problema Text Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.47 kb
Var f,g:text;
    s:string;
    a,i,b,c,d:integer;

Begin
assign(f, 'text.in');reset(f);
assign(g, 'text.out');rewrite(g);
read(f, s);
a:=length(s);
for i:=1 to a do
  begin
    if (s[i]<>' ') and (s[i]<>'-') and (s[i]<>'!') and (s[i]<>'?') and (s[i]<>',') then inc(b);
    if (s[i]=' ') or (s[i]='-') then inc(c);
    if s[i]=',' then
      begin
        inc(c);
        inc(d);
      end;
  end;
c:=c-d-1;
write(g, trunc(b/c));
close(f);
close(g);
End.