Pagini recente » Cod sursa (job #646811) | Cod sursa (job #873526) | Cod sursa (job #683917) | Cod sursa (job #730878) | Cod sursa (job #508186)
Cod sursa(job #508186)
const F='text.in'; G='text.out';
var
i,s,nr,t:longint;
stop:boolean;
c:char;
buf:array[1..1 shl 17] of char;
begin
assign(input,F);reset(input);
assign(output,G);rewrite(output);
settextbuf(input,buf);
s:=0;nr:=0;
stop:=false;
while not eof(input) do
begin
if (c>='a') and (c<='z') or (c>='A') and (c<='Z') then
begin
inc(s);
stop:=true;
end
else
if stop then
begin
s:=s+i;
inc(nr);
i:=0;
end;
end;
if stop then inc(nr);
t:=s div nr;
write(t);
close(input);close(output);
end.