public static void main(String[] args) {
int[] ints = { 1, 3, 10, 12 , 13, 18, 22 ,58 };
int find = 23;
int start = 0;
int end = ints.length-1;
if(ints[start] >= find){
System.out.println("都比他-------------------------------大哦!");
}else{
while (end > start) {
if (ints[start] + ints[end] == find) {
System.out.println(ints[start] + " + " + ints[end] + " = "
+ find);
end--;
start++;
} else if (ints[start] + ints[end] < find) {
start++;
} else if (ints[start] + ints[end] > find) {
end--;
}
}
}
}
int[] ints = { 1, 3, 10, 12 , 13, 18, 22 ,58 };
int find = 23;
int start = 0;
int end = ints.length-1;
if(ints[start] >= find){
System.out.println("都比他-------------------------------大哦!");
}else{
while (end > start) {
if (ints[start] + ints[end] == find) {
System.out.println(ints[start] + " + " + ints[end] + " = "
+ find);
end--;
start++;
} else if (ints[start] + ints[end] < find) {
start++;
} else if (ints[start] + ints[end] > find) {
end--;
}
}
}
}