Pagini recente » Cod sursa (job #1883838) | Cod sursa (job #1688232) | Cod sursa (job #2164619) | Cod sursa (job #2385551) | Cod sursa (job #535769)
Cod sursa(job #535769)
program flo;
var s,s1:string;
i,c,c1,q,lung,ascii,lungmax:integer;
lungmed:real;
ok:boolean;
f,g:text;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
i:=1;
s1:='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
read(f,s);
s:=s+'3';
for i:=1 to length(s)+1 do
begin
ok:=true;
if pos(s[i],s1)>0 then
begin
lung:=lung+1;
end
else
begin
lungmax:=lungmax+lung;
lung:=0;
if pos(s[i-1],s1)>0 then
c:=c+1;
end;
end;
lungmed:=lungmax/c;
writeln(g,trunc(lungmed));
close(f);
close(g);
end.