Pagini recente » Cod sursa (job #30559) | Cod sursa (job #1725688) | Cod sursa (job #1417417) | Cod sursa (job #856004) | Cod sursa (job #1615783)
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);
// letters:=0;
// words:=0;
read(input,ch);
if ch in ['a'..'z','A'..'Z'] then begin inc(letters); inc(words); end;
predch:=ch;
while not(eof(input)) do
begin
predch:=ch;
read(ch);
if ch in ['a'..'z','A'..'Z'] then inc(letters);
if (ch in ['a'..'z','A'..'Z']) and ((ord(predch)<65) or (ord(predch)>122) or ( (ord(predch)<97) and (ord(predch)>90) ) ) then inc(words);
end;
// if eoln(input) then readln(input);
// until eof(input);
// if ch in ['a'..'z','A'..'Z'] then inc(letters); if not( ch in ['a'..'z','A'..'Z']) then dec(words);
// writeln(predch,' ',ch);
// writeln(letters,' ',words);
write(output,letters div words);
close(input);
close(output);
end.