Pagini recente » Cod sursa (job #36906) | Cod sursa (job #2227038) | Cod sursa (job #2503049) | Cod sursa (job #113718) | Cod sursa (job #766913)
Cod sursa(job #766913)
program project1;
var c:char;
word:boolean;
n,m:integer;
fin,fout:text;
begin
assign (fin,'text.in');
reset (fin);
assign (fout,'text.out');
rewrite (fout);
n:=0;
m:=0;
word:=false;
while not(eof(fin)) do
begin
read (fin,c);
case (c) of
'a'..'z','A'..'Z':
begin
if (word=false) then
begin
word:=true;
inc(m);
end;
inc(n);
end;
else if (word=true) then word:=false;
end;
end;
write(fout,trunc(n/m));
close (fin);
close (fout);
end.