package sort;
public class Test57 {
public static void main(String[] args) {
printnumber(new int[]{1,2,3,4,5,6,7,8,9,10},10 );
} public static void printnumber(int[] s, int targe) {
int form = 0;
int to = s.length - 1;
while (form < to) {
if (s[form] + s[to] == targe) {
System.out.println("find" + s[form] + " " + s[to]);
return;
}
if (s[form] + s[to] > targe) {
to--;
}
if (s[form] + s[to] < targe) {
form++;
}
}
System.out.println("not found");
}
}