Pagini recente » Cod sursa (job #842462) | Cod sursa (job #280994) | Cod sursa (job #1234193) | Cod sursa (job #1910165) | Cod sursa (job #277295)
Cod sursa(job #277295)
var a,b:text;
arie:array[1..9000] of char;
lentotal,nrcuv,i,j,n,m:longint;
str:string;
begin
//WoooOOOOoooOOOooo!
assign(a,'text.in'); reset(a);
assign(b,'text.out'); rewrite(b);
while not EOF(a) do begin
i:=i+1;
read(a,arie[i]);
end;
if arie[1] <> ' ' then begin
j:=0;
repeat
j:=j + 1;
if (upcase(arie[j]) > 'A') AND (upcase(arie[j]) < 'Z') then
str:=str+ arie[j];
if arie[j+1] = ' ' then begin
nrcuv:=nrcuv+1;
lentotal:=lentotal + length(str);
str:=' ';
end;
until j = i;
write(b,lentotal div nrcuv);
end
else begin
write (b,'0');
end;
close(a); close(b);
end.