Pagini recente » Cod sursa (job #1919046) | Cod sursa (job #36810) | Cod sursa (job #626384) | Cod sursa (job #408004) | Cod sursa (job #46756)
Cod sursa(job #46756)
var k,s:char;
nrc,nr,ok,l: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);
k:=s;
while (not eof(f1)) do
begin
ok:=verf(s);
if ok=1 then begin l:=1;nr:=nr+1 end
else
begin
read(f1,s);
ok:=verf(s);
while (not eof(f1))and(ok=0) do
begin
read(f1,s);
ok:=verf(s);
end;
if ok=1 then begin nr:=nr+1; nrc:=nrc+1; l:=1; end;
end;
read(f1,s);
end;
nrc:=nrc+1;
if l=0 then writeln(f2,0)
else
if verf(k)=0 then writeln(f2,nr div nrc+1)
else writeln(f2,nr div nrc);
close(f1);
close(f2);
end.