Pagini recente » Cod sursa (job #1177238) | Statisticile problemei Det | Rating Cemartan Marian (marian20_10) | Cod sursa (job #1787400) | Cod sursa (job #1615809)
var ch,predch:char;
letters,words,ordinech,ordinepred:longint;
begin
assign(input,'text.in');
reset(input);
assign(output,'text.out');
rewrite(output);
read(input,ch);
predch:=ch;
ordinech:=ord(ch);
if ((ordinech>64)and(ordinech<91))or((ordinech>96)and(ordinech<123)) then
begin
inc(letters);
inc(words);
end;
while not(eof(input)) do
begin
predch:=ch;
read(input,ch);
ordinepred:=ord(predch);
ordinech:=ord(ch);
if (((ordinech<123)and(ordinech>96))or((ordinech<91)and(ordinech>64)))and((ordinepred<65)or(ordinepred>122)or((ordinepred>90)and(ordinepred<97))) then inc(words);
if ((ordinech>64)and(ordinech<91))or((ordinech>96)and(ordinech<123)) then inc(letters);
end;
write(output,letters div words);
close(input);
close(output);
end.