Pagini recente » Cod sursa (job #2763560) | Cod sursa (job #2551502) | Cod sursa (job #695752) | Cod sursa (job #2719587) | Cod sursa (job #491401)
Cod sursa(job #491401)
program text11;
var f,g:text;
d:longint;
a,y:char;
{c:set of 'A'..'z'; }
h,l:real;
p:boolean;
begin
l:=0;h:=0; d:=0;
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
y:=' ';
if not eof(f) then
begin
while not eof(f) do
begin
read(f,a);
if (ord(a)>=65) and (ord(a)<=127) then
begin
p:=true;
end
else
if (ord(y)>=65) and (ord(y)<=127) then
d:=d+1;
y:=a;
end;
if p=true then
begin
a:=' ';
if (ord(y)>=65) and (ord(y)<=127) then
d:=d+1;
close(f);reset(f);
while not eof(f) do
begin
read(f,a);
if (ord(a)>=65) and (ord(a)<=127) then
{if (ord(y)>=65) and (ord(y)<=127) then}
l:=l+1;
if trunc(l) mod 100000=0 then
begin
l:=l/d;
h:=h+l;
l:=0;
end;
end;
h:=h+l/d;
writeln(g,trunc(h));
end
else
writeln(g,'0');
end
else
writeln(g,'0');
close(f); close(g);
end.