题解 | #合法IP#
合法IP
http://www.nowcoder.com/practice/995b8a548827494699dc38c3e2a54ee9
while True:
try:
a = input().split('.')
b = 0
for i in a:
if i.isnumeric() == True and 0 <= int(i) <= 255:
if len(i) > 1 and i[0] == '0':
pass
else:
b += 1
if b == 4:
print('YES')
else:
print('NO')
except:
break