Pagini recente » Cod sursa (job #1352427) | Cod sursa (job #2300264) | Cod sursa (job #4810) | Cod sursa (job #272793) | Cod sursa (job #560599)
Cod sursa(job #560599)
program text2;
var s:string;
c:char;
p,i,z,n:integer;
f,g:text;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
read(f,s);
p:=0;
n:=length(s);
i:=1;
z:=0;
s[0]:=' ';
repeat
c:=s[i];
if ((c=' ') or (c='-') or (c=',') or (c='.') or (c='!') or (c='?')) and ((s[i-1]<>' ') and (s[i-1]<>'-') and (s[i-1]<>',') and (s[i-1]<>'.') and (s[i-1]<>'!') and (s[i-1]<>'?')) then
z:=z+1;
if (c<>' ') and (c<>'-') and (c<>',') and (c<>'.') and (c<>'!') and (c<>'?') then p:=p+1;
i:=i+1;
until i>n;
write(g,p div z);
writeln(g);
close(f);close(g);
end.