Pagini recente » Cod sursa (job #1087759) | Cod sursa (job #98340) | ichb_10_casi | Cod sursa (job #1646997) | Cod sursa (job #238039)
Cod sursa(job #238039)
program cuv;
var f,g:text;
nrlitere,t,nrcuvinte:integer;
c:char;
s:string;
ma:real;
BEGIN
assign(f,'text.in');
assign (g,'text.out');
reset(f);
rewrite(g);
nrlitere:=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;
read(f,c);
end;
ma:=nrlitere/nrcuvinte;
write(g,trunc(ma));
close(f);
close(g);
end.