Pagini recente » Cod sursa (job #623818) | Cod sursa (job #184078) | Cod sursa (job #2591092) | Cod sursa (job #2077967) | Cod sursa (job #42750)
Cod sursa(job #42750)
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);
nrc:=0;
nr:=0;
read(f1,s);
while (not eof(f1)) do
begin
ok:=verf(s);
if ok=0 then
begin
nrc:=nrc+1;
read(f1,s);
ok:=verf(s);
while (ok=0)and(not eof(f1)) do
begin
read(f1,s);
ok:=verf(s);
end;
if ok=1 then nr:=nr+1;
end
else nr:=nr+1;
read(f1,s);
end;
if verf(s)=1 then
nrc:= nrc+1;
writeln(f2,nr div nrc);
close(f2);
close(f1);
end.