public static void main(String[] args) {
Map<String, String> map = new HashMap<String,String>();
mapput("0268", "0A1B");
mapput("9631", "0A1B");
mapput("4172", "0A2B");
mapput("3425", "1A1B");
mapput("5746", "0A2B");
mapput("7529", "0A1B");
List<String> allResults = new CopyOnWriteArrayList<String>();
for(int i = 0;i < 10;i++){
for(int j = 0; j < 10;j++){
for(int a = 0; a < 10;a++){
for(int b = 0; b < 10;b++){
if(i != j && i != a && i != b && j != a && j !=b && a!= b){
allResultsadd(i + "" + j + "" + a + "" + b);
}
}
}
}
}
for(String key : mapkeySet()){
String value = mapget(key);
int a = IntegervalueOf(valuesubstring(0,1));
int b = IntegervalueOf(valuesubstring(2,3));
for(String result : allResults){
int countA = 0;
int countB = 0;
for(int i = 0; i < keylength();i++){
if(keycharAt(i) == resultcharAt(i)){
countA++;
continue;
}else{
for(int j = 0;j < resultlength(); j++){
if(keycharAt(i) == resultcharAt(j) && i != j){
countB++;
continue;
}
}
}
}
if(a != countA || b != countB){
allResultsremove(result);
}else{
}
}
}
for(String result : allResults){
Systemerrprintln(result);
}
}
我要回答|搜索相关资料
以上就是关于在线求帮忙,我现在有java语言编的程序想弄成C语言运行,求大神修改代码。下面是代码。全部的内容,包括:在线求帮忙,我现在有java语言编的程序想弄成C语言运行,求大神修改代码。下面是代码。、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)