Pagini recente » Cod sursa (job #259487) | Cod sursa (job #2448593) | Cod sursa (job #2592931) | Cod sursa (job #757850) | Cod sursa (job #919880)
Cod sursa(job #919880)
var f,g:text;
x:char;
nr,s:longint;
numara:boolean;
begin
nr:=0;
s:=0;
assign(f,'text.in');reset(f);
numara:=false;
while not eof(f) do
begin
read(f,x);
if x in ['A'..'z'] then
numara:=true;
if x in ['A'..'z'] then
s:=s+1
else
if (not(x in ['A'..'z'])) and (numara=true) then
begin
nr:=nr+1;
numara:=false
end
end;
close(f);
if x in ['A'..'z'] then
nr:=nr+1;
assign(g,'text.out');rewrite(g);
write(g,s div nr);
close(g);
end.