Pagini recente » Cod sursa (job #927391) | Cod sursa (job #3220956) | Cod sursa (job #730284) | Cod sursa (job #1671003) | Cod sursa (job #601261)
Cod sursa(job #601261)
Program texte;
var litere,simboluri:set of char;
s:string;
ch:char;
suma,cuvinte,j:longint;
f:text;
begin
assign(f,'text.in'); reset(F); read(f,ch);
litere:=['a'..'z','A'..'Z']; simboluri:=[chr(1)..chr(127)]-litere;
s:=''; suma:=0; cuvinte:=0;
while not eof(f) do begin
while ch in simboluri do read(f,ch);
while ch in litere do
begin
s:=s+ch;
read(f,ch);
end;
if length(s)>0 then
begin
suma:=suma+length(s);
inc(cuvinte);
s:='';
end;
end;
close(f); assign(f,'text.out'); rewrite(f);
writeln(f,suma div cuvinte); close(f);
end.