Pagini recente » Autentificare | Cod sursa (job #2112795) | Cod sursa (job #2281834) | Rezultate Info Oltenia 2018 Proba Individuala | Cod sursa (job #1526093)
program p3;
var s:string;
a,n,i :integer;
j:real;
f,g:text;
begin
assign (f,'text.in');
reset (f);
assign (g,'text.out');
rewrite (g);
read (f,s);
n:=1;
for i:=1 to length(s)do
If not (s[i] in ['a'..'z','A'..'Z']) then s[i]:='$';
{for i:=1 to length(s) do
If (s[i]='0') and (s[i+1]='0') then delete (s,i,1);
writeln (g,s);}
for i:=1 to length(s) do begin
If (s[i] in ['a'..'z','A'..'Z']) and (s[i+1]='$') then
begin
If i+2>=length(s)then n:=n
else
n:=n+1;
end;
If s[i] in ['a'..'z'] then a:=a+1;
If s[i] in ['A'..'Z'] then a:=a+1;
end;
j:=a/n;
writeln (g,j:0:0);
close (f);
close (g);
end.