Pagini recente » Cod sursa (job #717471) | Cod sursa (job #433390) | Cod sursa (job #1982460) | Cod sursa (job #433671) | Cod sursa (job #435290)
Cod sursa(job #435290)
var a:array[1..1000000000] of char;
n,nr,np,p:longint;
i:integer;
f,g:text;
c:char;
begin
assign(f,'text.in');
reset(f);
i:=1;
nr:=0;
np:=0;
while not eof(f) do
begin
read(f,c);
a[i]:=c;
inc(i);
end;
n:=i-1;
close(f);
assign(g,'text.out');
rewrite(g);
if (a[1]>='A') and (a[1]<='Z') or (a[1]>='a') and (a[1]<='z')
then begin
inc(nr);
inc(np);
end;
for i:=2 to n do
begin
if (a[i]>='A') and (a[i]<='Z') or (a[i]>='a') and (a[i]<='z')
then inc(nr);
if ((a[i-1]<'A') or (a[i-1]>'Z') and (a[i-1]<'a') or (a[i-1]>'z')) and
((a[i]>='A') and (a[i]<='Z') or (a[i]>='a') and (a[i]<='z'))
then inc(np);
end;
if np=0 then p:=0
else p:=nr div np;
writeln(g,p);
close(g);
end.