Pagini recente » Cod sursa (job #1186179) | Cod sursa (job #2952248) | Cod sursa (job #2906560) | Cod sursa (job #1037228) | Cod sursa (job #57036)
Cod sursa(job #57036)
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 (c1<='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:=lungcuv div nrcuv;
writeln(g,meda);
close(f);
close(g);
end.