Pagini recente » Cod sursa (job #857532) | Profil mamaie | Cod sursa (job #292261) | Cod sursa (job #1541946) | Cod sursa (job #177787)
Cod sursa(job #177787)
const m:set of char=['A'..'Z','a'..'z'];
var f:text;
c:char;
x,y,suma,nr:longint;
begin
assign(f,'text.in');reset(f);
x:=-1; y:=-1; suma:=0; nr:=0;
while not eof(f) do
begin
read(f,c);
if c in m then
if x=-1 then begin
x:=0; y:=0;
end
else inc(y)
else begin
if x<>-1 then begin
suma:=suma-x+y+1;
inc(nr);
end;
x:=-1; y:=-1;
end;
end;
if x<>-1 then
begin
suma:=suma-x+y+1;
inc(nr);
end;
close(f);
assign(f,'text.out');rewrite(f);
writeln(f,suma div nr);
close(f);
end.