Pagini recente » Cod sursa (job #898380) | Cod sursa (job #1678416) | Cod sursa (job #2749392) | Cod sursa (job #145106) | Cod sursa (job #71939)
Cod sursa(job #71939)
program text;
var s:ansistring;
l,c:int64;
// gasit:boolean;
procedure afisare;
var i:longint;
// e:double;
begin
assign(output,'text.out');
rewrite(output);
if c<>0 then //begin
// e:=l/c;
// i:=trunc(e); end
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] in ['A'..'Z','a'..'z']) then
l:=l+1
else if (s[i-1] in ['A'..'Z','a'..'z']) and
not (s[i] in ['A'..'Z','a'..'z']) and (l>=1) then
inc(c);
if s[length(s)]in ['A'..'Z','a'..'z']
then begin c:=c+1;{ gasit:=true} end
end;
procedure citire;
begin
assign(input,'text.in');
reset(input);
l:=0;
c:=0;
//gasit:=false;
while not {seek}eof do
begin
readln(s);
procesare;
end;
//if gasit then dec(c);
afisare;
close(input);
end;
begin
citire;
end.