Pagini recente » Cod sursa (job #64435) | Cod sursa (job #289303) | Cod sursa (job #2254699) | Cod sursa (job #335716) | Cod sursa (job #1615722)
var
ch,predch:char;
i,j,words,letters,chars:integer;
Begin
assign(input,'text.in'); reset(input);
assign(output,'text.out'); rewrite(output);
read(input,ch);
while not(ch in ['a'..'z','A'..'Z']) do read(input,ch);
letters:=0;
words:=1;
while not(eof(input)) do
begin
if ch in ['a'..'z','A'..'Z'] then begin inc(letters); predch:=ch; end;
if not(ch in ['a'..'z','A'..'Z']) and (predch in ['a'..'z','A'..'Z']) then begin inc(words); predch:=ch; end;
read(ch);
end;
write(output,letters div words);
close(input);
close(output);
end.