Pagini recente » Cod sursa (job #1117869) | Cod sursa (job #1733) | Cod sursa (job #1548629) | Cod sursa (job #3121768) | Cod sursa (job #306827)
Cod sursa(job #306827)
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;
litere:='qwertyuiopasdfghjklzxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM';
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.