Pagini recente » Cod sursa (job #2549377) | Cod sursa (job #2988155) | Cod sursa (job #2425713) | Cod sursa (job #2130470) | Cod sursa (job #1526097)
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 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,trunc(j));
close (f);
close (g);
end.