Pagini recente » Cod sursa (job #216228) | Cod sursa (job #2367225) | Cod sursa (job #729381) | Cod sursa (job #2939550) | Cod sursa (job #57016)
Cod sursa(job #57016)
program p1;
var f,g:text;
c1,c2:char;
nrcuv,lungcuv:Longint;
meda:Longint;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
nrcuv:=0;
lungcuv:=0;
c2:='}';
while not eof(f) do
begin
read(f,c1);
if ((c1>='a') and (c1<='z')) or ((c1>='A') and (c2<='Z')) then
if ((c2>='a') and (c2<='z')) or ((c2>='A') and (c2<='Z')) then lungcuv:=lungcuv+1
else begin nrcuv:=nrcuv+1; lungcuv:=lungcuv+1; end;
c2:=c1;
end;
meda:=0;
if nrcuv<>0 then
meda:=lungcuv div nrcuv;
writeln(g,meda);
close(g);
close(f);
end.