Pagini recente » Cod sursa (job #1845154) | Cod sursa (job #203012) | Cod sursa (job #1842045) | Cod sursa (job #1803498) | Cod sursa (job #306821)
Cod sursa(job #306821)
program texte;
var f,g:text;
s,prec,l:string[1];
litere:string;
k,lit,cuv:longint;
begin
assign(f,'text.in'); assign(g,'text.out');
reset(f); rewrite(g);
s[1]:=' '; prec[1]:=' ';
lit:=0; cuv:=0; k:=0;
litere:='qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM';
while not eof(f) do
begin
read(f,s[1]);
if pos(s[1],litere)<>0 then
begin
lit:=lit+1;
if pos(prec[1],litere)=0 then cuv:=cuv+1;
end;
if (eoln(f)) and not (eof(F))then l[1]:=s[1];
prec[1]:=s[1];
end;
if (pos(l[1],litere)<>0) and (pos(prec[1],litere)=0) then cuv:=cuv+1;
writeln(g,lit/cuv:0:0);
close(f); close(g);
end.