Pagini recente » Cod sursa (job #2880041) | Cod sursa (job #2934569) | Cod sursa (job #2296725) | Cod sursa (job #348968) | Cod sursa (job #166019)
Cod sursa(job #166019)
program textu;
var f,g:text;
x:char;
l:array[0..100]of longint;
a,ok,s,n,i:longint;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
while not(eof(f)) do
begin
read(f,x);
l[n]:=l[n]+1;
ok:=0;
if (x=' ') then ok:=1;
if (x='-') then ok:=1;
if (x='_') then ok:=1;
if (x=',') then ok:=1;
if (x='.') then ok:=1;
if (x='!') then ok:=1;
if (x='?') then ok:=1;
if (x=':') then ok:=1;
if (x=';') then ok:=1;
if (ok=1) then begin
l[n]:=l[n]-1;
n:=n+1;
end;
end;
for i:=0 to n-1 do s:=s+l[i];
a:=s div n;
write(g,a);
close(f);
close(g);
end.