Cod sursa(job #152900)
Utilizator | Stefan Gheorghe ghitza_2000 | Data | 9 martie 2008 21:37:21 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.57 kb |
var ct,S,d:longint;
i,c1:char;
f,g:text;
m:set of char;
begin
assign(f,'text.in'); reset(f);
m:=[];
for i:='a' to 'z' do
m:=m+[i];
d:=0;
ct:=0; s:=0;
for i:='A' to 'Z' do
m:=m+[i];
while (not eof(f)) do
begin
read(f,c1);
if c1='-' and eoln(f) then ct:=ct-1;
if eoln(f) then readln(f);
if [c1]*m<>[] then begin
d:=d+1;
inc(S);
end;
if (([c1]*m=[]) and (d<>0)) then begin inc(ct);
d:=0;
end;
end;
close(f);
assign(g,'text.out'); rewrite(g);
writeln(g,S div ct);
close(g);
end.