有序的整型数组(升序),给定一个数,两数相加返回true,否则返回false

public static boolean sum2(int ary[], int sum) { int start = 0; int end = ary.length - 1; for (; start < end; ) { if (ary[start] + ary[end] == sum) {
posted @ 2020-12-11 18:42  soft.push("zzq")  Views(106)  Comments(0Edit  收藏  举报