Pagini recente » Cod sursa (job #240618) | Cod sursa (job #1115832) | Cod sursa (job #1483691) | Cod sursa (job #1507084) | Cod sursa (job #166030)
Cod sursa(job #166030)
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 (x='"') then ok:=1;
if (x='+') then ok:=1;
if (ok=1) then
begin
l[n]:=l[n]-1;
if(l[n]>0)then 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.