Remove leading zeros from an IP address
Submissions: 1299   Accuracy:

45.05%

  Difficulty: Easy   Marks: 2

Given an IP address, remove leading zeros from the IP address.

Input:
The first line of the input contains a single integer T, denoting the number of test cases. Then T test case follows, a single line of the input containing an IP address N.

Output:
Print the IP address with leading zeros removed.

Constraints:
1<=T<=100

Example:

Input:

2
100.020.003.400
001.200.001.004

Ouput:

100.20.3.400
1.200.1.4

Explanation:

For testcase 1: The IP address 100.020.003.400 becomes 100.20.3.400 by removing the leading zeroes.

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Ankit Sharma
Author: Soul_xhacker


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.