Pagini recente » Cod sursa (job #1279970) | Cod sursa (job #1646046) | Cod sursa (job #1435143) | Cod sursa (job #1680995) | Cod sursa (job #46746)
Cod sursa(job #46746)
var s:char;
nrc,nr,ok:longint;
f2,f1:text;
function verf(s:char):integer;
var ok,x:longint;
begin
ok:=0;
x:=ord(s);
if (x>=97)and(x<=122) then ok:=1;
if (x>=65)and(x<=90) then ok:=1;
verf:=ok;
end;
begin
assign(f1,'text.in');
reset(f1);
assign(f2,'text.out');
rewrite(f2);
nr:=0;
nrc:=0;
read(f1,s);
while (not eof(f1)) do
begin
ok:=verf(s);
if ok=1 then
begin
nr:=nr+1;
read(f1,s);
while (not eof(f1))and(ok=1) do
begin
nr:=nr+1;
ok:=verf(s);
read(f1,s);
end;
nr:=nr-1;
nrc:=nrc+1;
end;
read(f1,s);
end;
if verf(s)=1 then nrc:=nrc+1;
if nrc=0 then writeln(f2,0)
else
writeln(f2,nr div nrc);
close(f1);
close(f2);
end.