package cn.longxingtx.number;
public class Number {
private void strNumber(String[] str_array, String str, String c) {
String str_new;
String c_new;
for(int i=0; i<str_array.length; i++) {
str_new = str;
if(str_new.length() == 2 && str_array[i].equals("4")) {
continue;
}
if(str_new.indexOf(str_array[i]) != -1) {
continue;
}
if(c.equals("3") && str_array[i].equals("5")) {
continue;
}
if(c.equals("5") && str_array[i].equals("3")) {
continue;
}
str_new += str_array[i];
c_new = str_array[i];
if(str_new.length() == 5) {
System.out.println(str_new.replace("a", "2"));
return;
}
strNumber(str_array, str_new, c_new);
}
}
/**
* @parai args
*/
public static void main(String[] args) {
Number number = new Number();
String c ="";
String[] str_array = {"1", "2", "a", "3", "4", "5"};
String str = "";
number.strNumber(str_array, str, c);
}
}