题解 | #整数与IP地址间的转换#
整数与IP地址间的转换
http://www.nowcoder.com/practice/66ca0e28f90c42a196afd78cc9c496ea
ip = list(map(int,input().split('.')))
ip_r = int(input())
out = ip[0]*(2**24) + ip[1]*(2**16) + ip[2]*(2**8) + ip[3]
print(out)
ip_r = '{:032b}'.format(ip_r)
out_ =[]
for i in range(4):
out_.append(ip_r[i*8:i*8+8])
out_ = [str(int(x,2)) for x in out_]
print('.'.join(out_))
ip_r = int(input())
out = ip[0]*(2**24) + ip[1]*(2**16) + ip[2]*(2**8) + ip[3]
print(out)
ip_r = '{:032b}'.format(ip_r)
out_ =[]
for i in range(4):
out_.append(ip_r[i*8:i*8+8])
out_ = [str(int(x,2)) for x in out_]
print('.'.join(out_))