Cod sursa(job #90511)
Utilizator | claudiu claudiu_sy | Data | 9 octombrie 2007 16:41:39 |
---|---|---|---|
Problema | Text | Scor | 60 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.64 kb |
var s:char;
f,g:text;
n,x,i,c,w:longint;
ok:boolean;
begin
assign(f,'text.in');
assign(g,'text.out');
reset(f);
rewrite(g);
c:=0;
x:=0;
repeat
i:=0;
ok:=false;
repeat
read(f,s);
if (s<>' ') and (s<>',') and (s<>'-') and (s<>'.') and (s<>'!') and (s<>'?') then begin
i:=i+1;
ok:=true;
end;
until (s=' ') or (eof(f)) or (s='-') or (s=',') or (s='.');
if ok then begin
x:=x+i;
c:=c+1;
end;
until (eof(f));
write(g,x div c);
close(f);
close(g);
end.