Submit | All submissions | Best solutions | Back to list |
IPADDR - IP Addresses |
IP addresses are formed from 32 character data streams of 1s and 0s. The decimal format of an IP address is formed by grouping 8 bits at a time and converting each binary group to a decimal number. Decimal IP addresses are written in the form of four integers separated by periods. An example of an IP address is 10.103.45.230.
Input
The first line of input will contain a single integer n that indicates the number of IP addresses to follow. Each of the following n lines will contain a 32 character binary number.
Output
For each binary IP address input, you will print the decimal format of the address.
Example
Input:Output:4
11111111111111111111111111111111
00000011100000001111111111111111
11110000101010100101010100000111
10101010101010101010101010101010255.255.255.255
3.128.255.255
240.170.85.7
170.170.170.170
Added by: | BYU Admin |
Date: | 2015-12-15 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 MAWK BC NCSHARP COFFEE DART FORTH GOSU JS-MONKEY JULIA KTLN OCT PROLOG PYPY3 R RACKET SQLITE SWIFT UNLAMBDA |
Resource: | UIL District 1 2009 #4 |