Cod sursa(job #456521)

Utilizator teban.mihaiTeban Mihai Andrei teban.mihai Data 15 mai 2010 20:24:21
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.52 kb
var n,k:longint;
    s:char;
    incepe:boolean;
    f,g:text;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
n:=0;
k:=0;
incepe:=false;
while not eof(f) do
 begin
 read(f,s);
 if ((s>='a') and (s<='z')) or ((s>='A') and (s<='Z')) then
  incepe:=true;
 if (incepe=true) and ((s=' ') or (s='!') or (s=',') or (s='.') or (s='?')or (s='-') or (s='"') then
  begin
  inc(k);
  incepe:=false;
  end;
 if (incepe=true) then
  inc(n);
 end;
writeln(g,n div k);
close(f);
close(g);
end.