@
ningyuqiao456 我测试过了, 应该没错。
//====================
bool find1(int num, int index, int* arr){ return num == arr[index]; }
bool find3(int num, int base_index, int* arr){ return find1(num, base_index, arr) || find1(num, base_index + 1, arr) || find1(num, base_index + 2, arr); }
bool find6(int num, int base_index, int* arr){ return find3(num, base_index, arr) || find3(num, base_index + 4, arr); }
bool find7(int num, int* arr, size_t size){ return find1(num, 0, arr) || find6(num, 1, arr); }
int main()
{
int arr[] = {1,22,56,53,34,51,77};
auto found = find7(53, arr, sizeof(arr));
assert(found);
}