Pagini recente » Cod sursa (job #544268) | Cod sursa (job #430861) | Cod sursa (job #1075574) | Cod sursa (job #3258210) | Cod sursa (job #536835)
Cod sursa(job #536835)
program mml;
var c:char;
c2,nr,contor:integer;
lung:real;
ok,ok1:boolean;
f,g:text;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
contor:=0;
nr:=0;
c2:=0;
While not seekeof(f) do
begin
ok:=false;
read(f,c);
If ((c>='a') and (c<='z')) or ((c>='A') and (c<='Z')) then
begin
ok:=true;
contor:=contor+1;
c2:=0;
end;
If (ok=false) and (contor<>0) then
begin
c2:=c2+1;
If c2=1 then
nr:=nr+1;
end;
end;
if c2<>0 then
lung:=contor/nr
else
lung:=contor/(nr+1);
writeln(g,trunc(lung));
close(f);
close(g);
end.