Pagini recente » Cod sursa (job #1011982) | Cod sursa (job #2471778) | Cod sursa (job #3214032) | Cod sursa (job #2630816) | Cod sursa (job #536820)
Cod sursa(job #536820)
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;
read(f,c);
ok1:=false;
If ((c>='a') and (c<='z')) or ((c>='A') and (c<='Z')) then
begin
ok1:=true;
contor:=contor+1;
c2:=0;
end;
If (ok1=false) then
begin
c2:=c2+1;
If c2=1 then
begin
nr:=0;
end;
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) then
begin
c2:=c2+1;
If c2=1 then
begin
nr:=nr+1;
end;
end;
end;
end;
If ok=false then
begin
lung:=contor/nr;
end;
lung:=contor/(nr+1);
writeln(g,trunc(lung));
close(f);
close(g);
end.