Pagini recente » Cod sursa (job #1565910) | Cod sursa (job #1660106) | Cod sursa (job #1601687) | Cod sursa (job #61113) | Cod sursa (job #278887)
Cod sursa(job #278887)
program cuv;
var f,g:text;
nrlitere,t,nrcuvinte:double;
c:char;
ma:double;
BEGIN
assign(f,'text.in');
assign (g,'text.out');
reset(f);
rewrite(g);
nrlitere:=0;
nrcuvinte:=0;
t:=0;
read(f,c);
while (not eof (f)) do begin
if ((c>='a') and (c<'z')) or ((c>='A') and (c<='Z')) then begin
nrlitere:=nrlitere+1;
if t=0 then nrcuvinte:=nrcuvinte+1;
t:=1; end
else
t:=0;
if eoln then readln(f,c)
else
read(f,c);
end;
ma:=nrlitere/nrcuvinte;
write(g,trunc(ma));
close(f);
close(g);
end.