Pagini recente » Cod sursa (job #2030869) | Rating Nush Nda (nda9898) | Cod sursa (job #1874964) | Cod sursa (job #2297461) | Cod sursa (job #1089495)
program textul;
var f :text;
s :string;
lc,i,nc :byte;
begin
assign(f,'textul.in');
reset(f);
read(f,s);
lc:=0;nc:=0;
for i:=1 to length(s) do begin
if s[i] in ['A'..'Z','a'..'z'] then inc(lc);
if (not(s[i] in ['A'..'Z','a'..'z']))and(s[i-1] in ['A'..'Z','a'..'z']) then inc(nc);
end;
close(f);
assign(f,'textul.out');
rewrite(f);
writeln(f,'Lungimea medie a cuvintelor este ',trunc(lc/nc));
close(f);
end.