Pagini recente » Cod sursa (job #709216) | Cod sursa (job #2436004) | Cod sursa (job #2988059) | Cod sursa (job #2704246) | Cod sursa (job #1615720)
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.