Pagini recente » Cod sursa (job #2212363) | Cod sursa (job #156386) | Cod sursa (job #1724102) | Clasamentul arhivei de probleme | Cod sursa (job #303070)
Cod sursa(job #303070)
var f,g:text;
i,con,suma,lcuv:longint;
cuv:String;
c:char;
rez:longint;
begin
assign (f,'text.in');
assign(g,'text.out');
reset(f);
rewrite(g);
cuv:=''; suma:=0; con:=0;
while not eoln(f) do begin
read(f,c);
if c in ['a'..'z','A'..'Z'] then inc(lcuv){cuv:=cuv+c}
else begin
if ({cuv<>''}lcuv<>0) then begin
suma:=suma+{length(cuv)}lcuv;
inc(con); end;
{cuv :=''}lcuv:=0;
end; end;
if ({cuv<>''}lcuv<>0) then begin
suma:=suma+{length(cuv)}lcuv;
inc(con);
end;
rez:=suma div con;
write(g,rez);
close(g);
end.