Pagini recente » Cod sursa (job #2624986) | Cod sursa (job #503754) | Cod sursa (job #354306) | Cod sursa (job #2054256) | Cod sursa (job #339582)
Cod sursa(job #339582)
var f:text; s:char; lungime,nrcuv:integer;
a,b:set of char;
cuvint:string;
begin
nrcuv:=0;
a:=['a'..'z'];
b:=['A'..'Z'];
Assign(f,'text.in');
reset(f);
While not eof(f) do
begin
While not eoln(f) do
begin
cuvint:='';
read(f,s);
While (s in a)or(s in b) do
begin
read(f,s);
cuvint:=cuvint+s;
end;
if cuvint<>'' then nrcuv:=nrcuv+1;
lungime:=lungime+length(cuvint);
end;
readln(f);
end;
Close(f);
Assign(f,'text.out') ;
rewrite(f);
Writeln(f,trunc(lungime/nrcuv));
Close(f);
end.