Pagini recente » Cod sursa (job #1878723) | Cod sursa (job #2497510) | Cod sursa (job #2987266) | Cod sursa (job #2876480) | Cod sursa (job #600734)
Cod sursa(job #600734)
Program paftenie;
var a:array [1..100000] of char;
fi, fo:text;
i,j,k,n,l:longint;
s:set of char;
begin
assign(fi,'text.in');
reset(fi);
i:=2; a[1]:=' ';
s:=['A'..'Z','a'..'z'];
while not eof(fi) do begin
read(fi,a[i]);
inc(i);
end;
n:=i-1;
i:=1;
while i<=n do begin
if a[i]=' ' then k:=i;
if a[i] in s then inc(l)
else if (a[i] in ['0'..'9']) then begin
l:=l-i+k+1;
dec(j);
repeat
if i<n-1 then
inc(i);
until (a[i+1]=' ') or (i=n);
end
else if (a[i]=' ') and (a[i+1] in s) then inc(j);
if (a[i]='-') and (a[i-1] in s) and (a[i+1] in s) then inc(j);
inc(i);
end;
assign(fo,'text.out');
rewrite(fo);
write(fo,trunc(l/j));
close(fo);
end.