Pagini recente » Cod sursa (job #2730420) | Cod sursa (job #3226303) | Cod sursa (job #1310422) | Cod sursa (job #1575711) | Cod sursa (job #598562)
Cod sursa(job #598562)
Program paftenie;
var a:array [1..100000] of char;
fi, fo:text;
i,j,k,n: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;
for i:=1 to n do
if a[i] in s then inc(k);
for i:=1 to n-1 do
if (a[i]=' ') and (a[i+1] in s) then inc(j);
for i:=2 to n-1 do
if (a[i]='-') and (a[i-1] in s) and (a[i+1] in s) then inc(j);
assign(fo,'text.out');
rewrite(fo);
write(fo,trunc(k/j));
close(fo);
end.