Cod sursa(job #835706)

Utilizator IronKingqwerty xxx IronKing Data 16 decembrie 2012 10:47:19
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.41 kb
Var f,g:text;
    s:string;
    a,i,b,c: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]=',') or (s[i]='-') then inc(c);
  end;
c:=c-2;
write(g, b,' ',c,' ',trunc(b/c));
close(f);
close(g);
End.