传入数据应该为地址如void sort(int* arr, int size, int (*compare)(int*, int*)) {
for (int i = 0; i < size - 1; i++) {
for (int j = 0; j < size - i - 1; j++) {
if (compare(&ar...
int trap(int* height, int heightSize){
if(heightSize<=2) return 0;
int left=0,right=heightSize-1;
int leftMax=height[0],rightMax=height[heightSize-1];
int ans=0;
while(left&l...