Pagini recente » Cod sursa (job #2355071) | Cod sursa (job #2693460) | Cod sursa (job #272099) | Autentificare | Cod sursa (job #335239)
Cod sursa(job #335239)
var a,b:char;
t:text;
lung,cuv:int64;
function adevarat(c:char):boolean;
begin
adevarat:=((ord(c)>64)and(ord(c)<91))or((ord(c)>96)and(ord(c)<123));
end;
begin
assign(t,'text.in'); reset(t);
read(t,a);
lung:=0;
cuv:=0;
if adevarat(a) then inc(lung);
b:=a;
while not(eoln(t)) do begin
read(t,a);
if adevarat(a) then inc(lung);
if adevarat(b) and (not(adevarat(a))) then inc(cuv);
b:=a;
end;
if (eoln(t))and(adevarat(a))then inc(cuv);
close(t);
assign(t,'text.out'); rewrite(t);
writeln(t,trunc(lung/cuv));
close(t);
end.