Pagini recente » Cod sursa (job #1479001) | Cod sursa (job #2268228) | Cod sursa (job #3001941) | Cod sursa (job #1354359) | Cod sursa (job #1615739)
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:=0;
repeat
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);
if eoln(input) then readln(input);
until eof(input);
if ch in ['a'..'z','A'..'Z'] then begin inc(letters); inc(words); end;
write(output,letters,' ', words);
close(input);
close(output);
end.