Pagini recente » Cod sursa (job #1869743) | Cod sursa (job #1681539) | Cod sursa (job #2520005) | Arhiva de probleme | Cod sursa (job #71243)
Cod sursa(job #71243)
program text;
var s,d:char;
l,c:integer;
gasit,f:boolean;
procedure afisare;
var i:integer;
begin
assign(output,'text.out');
rewrite(output);
if c<>0 then
i:=trunc(l/c)
else i:=0;
write(i);
close(output);
end;
procedure procesare;
var i:integer;
begin
//for i:=1 to length(s) do
f:=false;
while not eoln do begin
if f then
d:=s;
readln(s);
f:=true;
if (s in ['A'..'Z','a'..'z']) then
begin
l:=l+1;
gasit:=true;
end
else if (d in ['A'..'Z','a'..'z']) and
not (s in ['A'..'Z','a'..'z']) and (l>=1) and f then
begin
inc(c);
gasit:=false;
end;
end;
if s in ['A'..'Z','a'..'z']
then c:=c+1;
end;
procedure citire;
begin
assign(input,'text.in');
reset(input);
gasit:=false;
while not seekeof do
begin
// if gasit then
// c:=c-1;
procesare;
readln;
end;
afisare;
close(input);
end;
begin
citire;
end.