|
|
@ -0,0 +1,22 @@ |
|
|
|
|
|
public class NumbersInString{ |
|
|
|
|
|
public static void numbersInString (String input) { |
|
|
|
|
|
String[] parts = input.split("\\*\\*(?:[^0-9]+)?"); |
|
|
|
|
|
int max = -1; |
|
|
|
|
|
int temp = 0; |
|
|
|
|
|
for (int i = 0;i<parts.length;i++){ |
|
|
|
|
|
temp = Integer.parseInt(parts[i]); |
|
|
|
|
|
max = Math.max(temp,max); |
|
|
|
|
|
} |
|
|
|
|
|
System.out.println("Max: "+max); |
|
|
|
|
|
} |
|
|
|
|
|
public static void main(String[] args){ |
|
|
|
|
|
String input; |
|
|
|
|
|
if (args.length > 0){ |
|
|
|
|
|
input = args[0]; |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
input = "3**1**June**NEIU**0**Move**9"; |
|
|
|
|
|
} |
|
|
|
|
|
numbersInString(input); |
|
|
|
|
|
} |
|
|
|
|
|
} |