Pagini recente » Cod sursa (job #537689) | Cod sursa (job #1281116) | Cod sursa (job #1416199) | Cod sursa (job #1368998) | Cod sursa (job #727797)
Cod sursa(job #727797)
var f:text;
pre,c:char;
flag:boolean;
lit,m:longint;cuv:word;
begin
assign(f,'text.in');
reset(f);
cuv:=0;
flag:=true;
lit:=0;
read(f,c);
while (not eof(f))do
begin
if (not flag)and(c in ['a'..'z','A'..'Z']) then begin
flag:=true;
cuv:=cuv+1;
end;
if c in ['a'..'z','A'..'Z'] then begin
inc(lit);
flag:=true;
end
else
flag:=false;
pre:=c;
read(f,c);
if(eof(f))and(flag=true)then inc(cuv);
end;
if (not (pre in ['a'..'z','A'..'Z'])) then inc(cuv);
close(f);
assign(f,'text.out');
rewrite(f);
if(cuv<>0) then begin
m:=lit div cuv;
write(f,m);
end;
close(f);
end.