Pagini recente » Cod sursa (job #2723905) | Cod sursa (job #360905) | Cod sursa (job #1019722) | Cod sursa (job #1410338) | Cod sursa (job #536822)
Cod sursa(job #536822)
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;
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;
If ok=false then
begin
lung:=contor/nr;
end;
lung:=contor/(nr+1);
writeln(g,trunc(lung));
close(f);
close(g);
end.