题解 | #合法IP#
合法IP
https://www.nowcoder.com/practice/995b8a548827494699dc38c3e2a54ee9
while True:
try:
s=input().split('.')
l=''
if len(s)==4:
for a in s:
if a.isdigit() and (str(int(a))==a):
l=bin(int(a))[2:]
if len(l)>8:
print('NO')
break
else:
print('NO')
break
else:
print('YES')
else:
print('NO')
except:
break
