Pagini recente » Cod sursa (job #1876390) | Cod sursa (job #1001850) | Cod sursa (job #1550495) | Cod sursa (job #148261) | Cod sursa (job #1615747)
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;
// repeat
while not(eof(input)) do
begin
if ch in ['a'..'z','A'..'Z'] then inc(letters);
if not(ch in ['a'..'z','A'..'Z']) and (predch in ['a'..'z','A'..'Z']) then inc(words);
predch:=ch;
read(ch);
end;
// if eoln(input) then readln(input);
// until eof(input);
if ch in ['a'..'z','A'..'Z'] then inc(letters);
// writeln(predch,' ',ch);
write(output,letters div words);
close(input);
close(output);
end.