Pagini recente » Cod sursa (job #3247958) | Cod sursa (job #1997147) | Cod sursa (job #1228548) | Cod sursa (job #200796) | Cod sursa (job #71943)
Cod sursa(job #71943)
program text;
var s:string;//ansistring;
l,c:int64;
procedure afisare;
var i:longint;
begin
assign(output,'text.out');
rewrite(output);
if c<>0 then
i:=l div c
else i:=0;
write(i);
close(output);
end;
procedure procesare;
var i:longint;
begin
for i:=1 to length(s) do
if ((s[i]>='A') and (s[i]<='Z')) or ((s[i]>='a') and (s[i]<='z')) then
l:=l+1
else if (((s[i]>='A') and (s[i]<='Z')) or ((s[i]>='a') and (s[i]<='z')))
and not (((s[i-1]='A') and (s[i-1]<='Z')) or ((s[i-1]>='a') and (s[i-1]<='z')))
then
inc(c);
if ((s[length(s)]>='A') and (s[length(s)]<='Z')) or
((s[length(s)]>='a') and (s[length(s)]<='z'))
then begin c:=c+1; end
end;
procedure citire;
begin
assign(input,'text.in');
reset(input);
l:=0;
c:=0;
while not seekeof do
begin
readln(s);
procesare;
end;
afisare;
close(input);
end;
begin
citire;
end.