Cod sursa(job #584727)

Utilizator lehman97Dimulescu David lehman97 Data 26 aprilie 2011 15:18:21
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.39 kb
var    c:char;
       g,s,u:longint;
begin
assign(input,'text.in');reset(input);
assign(output,'text.out');rewrite(output);
g:=0;
s:=0;
u:=0;
while not eof(input) do begin
read(c);
if (upcase(c) in['A'..'Z']) then inc(g) else begin
if g<>0 then begin
s:=s+g;
inc(u);
g:=0;
end;
end;
end;
if g<>0 then  begin
inc(u);
s:=s+g;
g:=0;
end;
write(s div u);
close(output);
end.