题解 | #合法IP#
合法IP
https://www.nowcoder.com/practice/995b8a548827494699dc38c3e2a54ee9
# 非常简洁版python代码
input = list(map(str, input().split('.')))
f = True
if len(input) != 4 or '' in input:
print('NO')
exit()
for i in range(len(input)):
if len(input[i]) > len(str(int(input[i]))) or int(input[i]) > 255 or int(input[i]) < 0:
f = False
break
if f:
print('YES')
else:
print('NO')