Попробуй так: var s:string; A,N,M,X,Y,Z:integer; begin write('s:'); readln(s); A:=1; N:=4; while (A<15) and (N<15) do for A:=1 to (N-1) do begin X:=StrToInt(s[1]); Y:=StrToInt(s[2]); Z:=StrToInt(s[3]); M:=100*X+10*Y+Z; A:=A+4; N:=N+3; end; if M<256 then writeln('YES') else writeln('NO'); end.
var s:string;
A,N,M,X,Y,Z:integer;
begin
write('s:');
readln(s);
A:=1; N:=4;
while (A<15) and (N<15) do
for A:=1 to (N-1) do
begin
X:=StrToInt(s[1]);
Y:=StrToInt(s[2]);
Z:=StrToInt(s[3]);
M:=100*X+10*Y+Z;
A:=A+4;
N:=N+3;
end;
if M<256 then writeln('YES')
else writeln('NO');
end.