Created
December 15, 2012 15:12
-
-
Save marawannwh/4296198 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.StringTokenizer; | |
import java.util.NoSuchElementException; | |
public class IpCutter3 { | |
public static void main (String[]args) { | |
StringTokenizer Q = new StringTokenizer(args[0]); | |
String[]k=new String[4]; | |
try { | |
for (int i=0;i<4;i++) | |
k[i]=Q.nextToken("."); | |
} | |
catch (NoSuchElementException ex ) { | |
System.out.println("Error : You have entered an invalid IP address"); | |
System.exit(0); } | |
for (int i=0;i<4;i++) | |
System.out.println(k[i]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment